diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index ddb543dc3b068..21385064c5d25 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -1,4 +1,4 @@ -name: Cross-build +name: Cross-build kernel # XXX keep paths in sync on: @@ -6,64 +6,81 @@ on: branches: [ main, 'stable/14', 'stable/13' ] paths: - 'sys/**' - - 'stand/**' - - - 'bin/**' - - 'sbin/**' - - 'usr.bin/**' - - 'usr.sbin/**' # XXX What to build here? - 'Makefile' - 'Makefile.inc1' - '**/cross-bootstrap-tools.yml' - - - '!**.[1-9]' # Ignore manpages pull_request: branches: [ main ] paths: - 'sys/**' - - 'stand/**' - - - 'bin/**' - - 'sbin/**' - - 'usr.bin/**' - - 'usr.sbin/**' # XXX What to build here? - 'Makefile' - 'Makefile.inc1' - '**/cross-bootstrap-tools.yml' - - - '!**.[1-9]' # Ignore manpages workflow_dispatch: permissions: contents: read jobs: - modified_files: - name: get modified files + setup: + name: Setup runs-on: ubuntu-latest outputs: - changes: ${{ steps.changes.outputs.files }} + archs: ${{ steps.archs.outputs.matches }} steps: - - uses: actions/checkout@v4 - - name: get modified files + - name: checkout + uses: actions/checkout@v4 + - name: filter paths + uses: dorny/paths-filter@v3 id: changes + with: + base: ${{ github.ref_name }} + filters: | + amd64: + - 'sys/amd64/**' + i386: + - 'sys/i386/**' + arm64: + - 'sys/arm64/**' + arm: + - 'sys/arm/**' + powerpc: + - 'sys/powerpc/**' + riscv: + - 'sys/riscv/**' + all: + - '**/cross-bootstrap-tools.yml' + - name: match paths + id: archs + shell: bash run: | - echo "files=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.push.before }} ${{ github.sha }} | xargs)" - echo "files=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.push.before }} ${{ github.sha }} | xargs)" >> $GITHUB_OUTPUT + if ${{ steps.changes.outputs.all }}; then + matches=(amd64 armv7 aarch64 i386 powerpc powerpc64 powerpc64le riscv64) + else + matches=() + if ${{ steps.changes.outputs.amd64 }}; then + matches+=(amd64) + fi + if ${{ steps.changes.outputs.arm64 }}; then + matches+=(aarch64) + fi + fi + matches="${matches[*]}" + echo "matches=[${matches// /,}]" | tee "$GITHUB_OUTPUT" build: - name: ${{ matrix.target_arch }} buildkernel on ${{ matrix.os }} (${{ matrix.compiler }}) + name: ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) runs-on: ${{ matrix.os }} - needs: modified_files + needs: setup strategy: fail-fast: false matrix: - target_arch: [ amd64, aarch64, powerpc ] + target_arch: amd64, powerpc os: [ ubuntu-22.04, ubuntu-24.04, macos-latest ] include: # TODO: both Ubuntu and macOS have bmake packages, we should try them instead of bootstrapping our own copy. @@ -87,9 +104,6 @@ jobs: target: powerpc steps: - uses: actions/checkout@v4 - - name: check modified files - run: | - echo ${{ needs.modified_files.outputs.changes }} && exit 1 - name: install packages (Ubuntu) if: runner.os == 'Linux' run: |