mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2026-02-02 23:47:48 +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
|
||||
run: |
|
||||
echo "G_TARGET_ARCH = $G_TARGET_ARCH"
|
||||
rm -rf staging_dir/
|
||||
rm -rf build_dir/
|
||||
|
||||
mkdir -p staging_dir/host
|
||||
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
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: staging_dir/host
|
||||
key: host-tools-${{ runner.os }}-${{ hashFiles('tools/**') }}
|
||||
save-always: true
|
||||
restore-keys: |
|
||||
host-tools-${{ runner.os }}-
|
||||
|
||||
- name: Cache toolchain
|
||||
if: false
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: staging_dir/toolchain-*
|
||||
key: toolchain-${{ env.G_TARGET_ARCH }}-${{ hashFiles('toolchain/**') }}
|
||||
save-always: true
|
||||
restore-keys: |
|
||||
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
|
||||
id: tools
|
||||
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
||||
@@ -285,20 +318,6 @@ jobs:
|
||||
make toolchain/install -j$(nproc)
|
||||
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
|
||||
id: kernel
|
||||
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)
|
||||
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
|
||||
id: compile
|
||||
if: steps.tools.outputs.status == 'success'
|
||||
@@ -361,6 +390,13 @@ jobs:
|
||||
- name: Check space usage
|
||||
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
|
||||
if: always()
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user