Skip to content

Commit

Permalink
Again
Browse files Browse the repository at this point in the history
  • Loading branch information
VexedUXR committed Nov 13, 2024
1 parent 5d8c5ff commit 2ed77f8
Showing 1 changed file with 44 additions and 30 deletions.
74 changes: 44 additions & 30 deletions .github/workflows/cross-bootstrap-tools.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,86 @@
name: Cross-build
name: Cross-build kernel

# XXX keep paths in sync
on:
push:
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: ${{ fromJSON(needs.setup.outputs.archs) }}
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.
Expand All @@ -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: |
Expand Down

0 comments on commit 2ed77f8

Please sign in to comment.