5 Commits

Author SHA1 Message Date
remittor
8739c51995 build: Disable step "Cache toolchain" and fix host dir 2025-12-31 22:52:42 +03:00
remittor
ea8d7eea5f build: Add show CPU cores 2025-12-31 19:48:32 +03:00
remittor
1d93b461b7 build: Add step "Increase swap" and "Check OOM error" 2025-12-31 19:27:22 +03:00
remittor
cfc8241f53 build: Add option save-always: true 2025-12-31 19:13:43 +03:00
remittor
8c2f6fd7de build: Add step "Monitor memory" 2025-12-31 18:57:30 +03:00

View File

@@ -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: