mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2026-02-11 11:47:07 +05:00
Compare commits
5 Commits
e021297496
...
8739c51995
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8739c51995 | ||
|
|
ea8d7eea5f | ||
|
|
1d93b461b7 | ||
|
|
cfc8241f53 | ||
|
|
8c2f6fd7de |
70
.github/workflows/build.yml
vendored
70
.github/workflows/build.yml
vendored
@@ -259,25 +259,58 @@ jobs:
|
|||||||
- name: Prepare for use cache of tools and toolchain
|
- name: Prepare for use cache of tools and toolchain
|
||||||
run: |
|
run: |
|
||||||
echo "G_TARGET_ARCH = $G_TARGET_ARCH"
|
echo "G_TARGET_ARCH = $G_TARGET_ARCH"
|
||||||
rm -rf staging_dir/
|
mkdir -p staging_dir/host
|
||||||
rm -rf build_dir/
|
rm -rf /tmp/staging-host
|
||||||
|
mkdir -p /tmp/staging-host
|
||||||
|
cp -a staging_dir/host/* /tmp/staging-host/
|
||||||
|
rm -rf staging_dir/host/*
|
||||||
|
|
||||||
- name: Cache host tools
|
- name: Cache host tools
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: staging_dir/host
|
path: staging_dir/host
|
||||||
key: host-tools-${{ runner.os }}-${{ hashFiles('tools/**') }}
|
key: host-tools-${{ runner.os }}-${{ hashFiles('tools/**') }}
|
||||||
|
save-always: true
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
host-tools-${{ runner.os }}-
|
host-tools-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Cache toolchain
|
- name: Cache toolchain
|
||||||
|
if: false
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: staging_dir/toolchain-*
|
path: staging_dir/toolchain-*
|
||||||
key: toolchain-${{ env.G_TARGET_ARCH }}-${{ hashFiles('toolchain/**') }}
|
key: toolchain-${{ env.G_TARGET_ARCH }}-${{ hashFiles('toolchain/**') }}
|
||||||
|
save-always: true
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
toolchain-${{ env.G_TARGET_ARCH }}-
|
toolchain-${{ env.G_TARGET_ARCH }}-
|
||||||
|
|
||||||
|
- name: Restore saved host staging
|
||||||
|
run: |
|
||||||
|
cp -af /tmp/staging-host/* staging_dir/host
|
||||||
|
rm -rf /tmp/staging-host
|
||||||
|
|
||||||
|
- name: Increase swap to 16G
|
||||||
|
if: false
|
||||||
|
run: |
|
||||||
|
free -h
|
||||||
|
sudo swapoff -a || true
|
||||||
|
sudo rm -f /swapfile
|
||||||
|
sudo fallocate -l 16G /swapfile
|
||||||
|
sudo chmod 600 /swapfile
|
||||||
|
sudo mkswap /swapfile
|
||||||
|
sudo swapon /swapfile
|
||||||
|
|
||||||
|
- name: Monitor memory
|
||||||
|
run: |
|
||||||
|
echo "CPU cores = $(nproc)"
|
||||||
|
echo "Memory and swap:"
|
||||||
|
sudo free -h
|
||||||
|
echo
|
||||||
|
sudo swapon --show
|
||||||
|
echo
|
||||||
|
echo "Available storage:"
|
||||||
|
sudo df -h
|
||||||
|
|
||||||
- name: Build tools and toolchain
|
- name: Build tools and toolchain
|
||||||
id: tools
|
id: tools
|
||||||
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
||||||
@@ -285,20 +318,6 @@ jobs:
|
|||||||
make toolchain/install -j$(nproc)
|
make toolchain/install -j$(nproc)
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Save cache for host tools
|
|
||||||
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: staging_dir/host
|
|
||||||
key: host-tools-${{ runner.os }}-${{ hashFiles('tools/**') }}
|
|
||||||
|
|
||||||
- name: Save cache for toolchain
|
|
||||||
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: staging_dir/toolchain-*
|
|
||||||
key: toolchain-${{ env.G_TARGET_ARCH }}-${{ hashFiles('toolchain/**') }}
|
|
||||||
|
|
||||||
- name: Kernel compile
|
- name: Kernel compile
|
||||||
id: kernel
|
id: kernel
|
||||||
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.first_kernel_compile == 'true' && github.event.inputs.fake_build != 'true' }}
|
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.first_kernel_compile == 'true' && github.event.inputs.fake_build != 'true' }}
|
||||||
@@ -306,6 +325,16 @@ jobs:
|
|||||||
make target/linux/compile -j$(nproc)
|
make target/linux/compile -j$(nproc)
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Monitor memory 2
|
||||||
|
run: |
|
||||||
|
echo "Memory and swap:"
|
||||||
|
sudo free -h
|
||||||
|
echo
|
||||||
|
sudo swapon --show
|
||||||
|
echo
|
||||||
|
echo "Available storage:"
|
||||||
|
sudo df -h
|
||||||
|
|
||||||
- name: Build the firmware image
|
- name: Build the firmware image
|
||||||
id: compile
|
id: compile
|
||||||
if: steps.tools.outputs.status == 'success'
|
if: steps.tools.outputs.status == 'success'
|
||||||
@@ -361,6 +390,13 @@ jobs:
|
|||||||
- name: Check space usage
|
- name: Check space usage
|
||||||
run: df -hT
|
run: df -hT
|
||||||
|
|
||||||
|
- name: Check OOM error
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
dmesg | grep -i -E 'oom|killed process' || true
|
||||||
|
echo "================== Memory ================="
|
||||||
|
free -h
|
||||||
|
|
||||||
- name: Compress build logs
|
- name: Compress build logs
|
||||||
if: always()
|
if: always()
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user