Add runner control to the matrix (#2)

This commit is contained in:
Igor Pečovnik
2023-02-23 12:21:59 +01:00
committed by GitHub
parent 21611dd0e7
commit 8d07cc719f

View File

@@ -48,9 +48,15 @@ jobs:
source build/config/boards/$line.wip 2> /dev/null || true
source build/config/boards/$line.tvb 2> /dev/null || true
source build/config/sources/families/${BOARDFAMILY}.conf 2> /dev/null || true
echo "${LINUXFAMILY}:${BOARDFAMILY}:${BRANCH}:${line}:${ARCH}"
# runner management
RUNNER=ubuntu-latest
[[ "${ARCH}" == arm64 ]] && RUNNER=aarch64
[[ "${BRANCH}" == current ]] && RUNNER=alfa
[[ "${BRANCH}" == edge ]] && RUNNER=beta
echo "${LINUXFAMILY}:${BOARDFAMILY}:${BRANCH}:${line}:${RUNNER}"
done <<< "$FILES"
done | sort | uniq | sort -u -t: -k1,3 | cut -d":" -f3,4 | sort | uniq | sed "s/:/ /" | awk '{ printf "%s%s\n", "{\"branch\":\""$1"\",", "\"board\":\""$2"\"}" }' | jq -s >> $GITHUB_OUTPUT
done | sort | uniq | sort -u -t: -k1,3 | cut -d":" -f3,4,5 | sort | uniq | sed "s/:/ /g" | awk '{ printf "%s%s%s\n", "{\"board\":\""$2"\",", "\"branch\":\""$1"\",", "\"runner\":\""$3"\"}" }' | jq -s >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
kernel:
if: ${{ github.repository_owner == 'armbian' }}
@@ -59,8 +65,10 @@ jobs:
fail-fast: false # let other jobs try to complete if one fails
matrix:
include: ${{ fromJSON(needs.prepare.outputs.matrix) }}
runs-on: "alfa"
name: "${{ matrix.board }} ${{ matrix.branch }}"
runs-on: "${{ matrix.runner }}"
name: "${{ matrix.board }} ${{ matrix.branch }} ${{ matrix.runner }}"
env:
BRANCH: "${{ matrix.branch }}"
BOARD: "${{ matrix.board }}"