Use massive parallel in workflow for PRs

This to get quick turnaround development -> test when
doing PRs main branch builds and release builds are still
build sequentially.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
This commit is contained in:
Mattias Walström
2025-05-13 08:02:16 +02:00
parent 6a2abd962f
commit 874c0a54c4
+21 -2
View File
@@ -13,7 +13,11 @@ on:
required: false required: false
default: true default: true
type: boolean type: boolean
parallell:
description: 'Massive parallel build of each image'
required: false
default: true
type: boolean
jobs: jobs:
build: build:
name: Build Infix ${{ matrix.target }} name: Build Infix ${{ matrix.target }}
@@ -71,6 +75,7 @@ jobs:
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
echo "flv=$flavor" >> $GITHUB_OUTPUT echo "flv=$flavor" >> $GITHUB_OUTPUT
echo "Building target ${target}${flavor}_defconfig" echo "Building target ${target}${flavor}_defconfig"
- name: Restore Cache of dl/ - name: Restore Cache of dl/
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@@ -96,10 +101,24 @@ jobs:
run: | run: |
make test-unit make test-unit
- name: Prepare parallel build
id: parallel
run: |
if [ "${{ ((github.event.inputs.parallel == 'true' && github.event_name == 'workflow_dispatch') || (github.ref_name != 'main' && github.event_name != 'workflow_dispatch')) }}" == "true" ]; then
echo "BR2_PER_PACKAGE_DIRECTORIES=y" >> output/.config
MAKE="make -j$((`getconf _NPROCESSORS_ONLN` / 2 + 2))"
echo "Building in parallel with -j$((`getconf _NPROCESSORS_ONLN` / 2 + 2))"
else
echo "Disabling parallel build"
MAKE="make"
fi
echo "MAKE=$MAKE" >> $GITHUB_OUTPUT
- name: Build ${{ matrix.target }}${{ steps.vars.outputs.flv }} - name: Build ${{ matrix.target }}${{ steps.vars.outputs.flv }}
run: | run: |
echo "Building ${{ matrix.target }}${{ steps.vars.outputs.flv }}_defconfig ..." echo "Building ${{ matrix.target }}${{ steps.vars.outputs.flv }}_defconfig ..."
make eval "${{ steps.parallel.outputs.MAKE }}"
- name: Check SBOM from Build - name: Check SBOM from Build
run: | run: |