workflow: move build operations in a reusable workflow #537
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bpf-ci | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- bpf_base | ||
- bpf-next_base | ||
concurrency: | ||
group: ci-test-${{ github.ref_name }} | ||
cancel-in-progress: true | ||
jobs: | ||
set-matrix: | ||
# FIXME: set-matrix is lightweight, run it on any self-hosted machines for kernel-patches org | ||
# so we do not wait for GH hosted runners when there potentially all are busy because of bpf-rc | ||
# repo for instance. | ||
# This could be somehow fixed long term by making this action/workflow re-usable and letting the called | ||
# specify what to run on. | ||
runs-on: ${{ github.repository_owner == 'kernel-patches' && 'x86_64' || 'ubuntu-latest' }} | ||
outputs: | ||
build-matrix: ${{ steps.set-matrix-impl.outputs.build_matrix }} | ||
test-matrix: ${{ steps.set-matrix-impl.outputs.test_matrix }} | ||
veristat-runs-on: ${{ steps.set-matrix-impl.outputs.veristat_runs_on }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: set-matrix-impl | ||
run: | | ||
python3 .github/scripts/matrix.py | ||
# Build kernel and selftest | ||
build: | ||
uses: ./.github/workflows/kernel-build.yml | ||
needs: set-matrix | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.set-matrix.outputs.build-matrix) }} | ||
with: | ||
arch: ${{ matrix.arch }} | ||
toolchain_full: ${{ matrix.toolchain_full }} | ||
toolchain: ${{ matrix.toolchain }} | ||
runs_on: ${{ toJSON(matrix.runs_on) }} | ||
llvm-version: ${{ matrix.llvm-version }} | ||
kernel: ${{ matrix.kernel }} | ||
test: | ||
uses: ./.github/workflows/kernel-test.yml | ||
needs: [set-matrix, build] | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.set-matrix.outputs.test-matrix) }} | ||
with: | ||
arch: ${{ matrix.arch }} | ||
toolchain_full: ${{ matrix.toolchain_full }} | ||
runs_on: ${{ toJSON(matrix.runs_on) }} | ||
kernel: ${{ matrix.kernel }} | ||
test: ${{ matrix.test }} | ||
continue_on_error: ${{ matrix.continue_on_error }} | ||
timeout_minutes: ${{ matrix.timeout_minutes }} | ||
veristat: | ||
uses: ./.github/workflows/kernel-veristat.yml | ||
Check failure on line 63 in .github/workflows/test.yml GitHub Actions / bpf-ciInvalid workflow file
|
||
needs: [set-matrix, build] | ||
with: | ||
arch: x86_64 | ||
toolchain: gcc | ||
aws_region: ${{ vars.AWS_REGION }} | ||
secrets: | ||
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }} |