From 81b5fee3883a201979e53114609b2df51bed65d6 Mon Sep 17 00:00:00 2001 From: Ahmad Khalifa Date: Sun, 1 Dec 2024 23:30:53 +0200 Subject: [PATCH] Test --- .github/workflows/cross-bootstrap-tools.yml | 65 +++++++++++++++++++-- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index a6e6791ccbe5c2..9c2a2a42e3efb6 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -3,21 +3,71 @@ name: Cross-build Kernel on: push: branches: [ main, 'stable/14', 'stable/13' ] + #paths: [ sys ] pull_request: branches: [ main ] + #paths: [ sys ] workflow_dispatch: permissions: contents: read jobs: + setup: + runs-on: ubuntu-latest + outputs: + kern_archs: ${{ steps.match.outputs.kern_archs }} + steps: + - name: checkout + uses: actions/checkout@v4 + - name: generate filters + run: | + filters='${{ runner.temp }}/filters.yml' + + for t in amd64 i386 arm64 arm powerpc riscv + do + files="sys/conf/files.$t" + + if [ "$t" = "amd64" ] || [ "$t" = "i386" ]; then + files="$files sys/conf/files.x86" + fi + + case "$t" in + "arm64") a="aarch64";; + "arm") a="armv7";; + "riscv") a="riscv64";; + *) a=$t;; + esac + + echo "$a: &$t [$(cat $files | grep -Eo '^[A-Za-z0-9/_-]*\.[cmhS]{1,2}' | sed 's;[^ ]*;"&",;g')]" >> $filters + done + + echo 'powerpc64: *powerpc' >> $filters + echo 'powerpc64le: *powerpc' >> $filters + + echo 'all: [ "sys/kern/**", "sys/vm/**" ]' >> $filters + - name: filter + id: filter + uses: dorny/paths-filter@v3 + with: + base: ${{ github.ref }} + filters: ${{ runner.temp }}/filters.yml + - name: match + id: match + run: | + if ${{ steps.filter.outputs.all }}; then + echo 'kern_archs=[ "amd64", "i386", "aarch64", "armv7", "powerpc", "powerpc64", "powerpc64le", "riscv64" ]' >> $GITHUB_OUTPUT + else + echo 'kern_archs=${{ steps.filter.outputs.changes }}' >> $GITHUB_OUTPUT + fi build: name: ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) runs-on: ${{ matrix.os }} + needs: setup strategy: fail-fast: false matrix: - target_arch: [ amd64, aarch64 ] + target_arch: ${{ fromJSON(needs.setup.outputs.kern_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. @@ -33,10 +83,15 @@ jobs: compiler: clang-18 cross-bindir: /opt/homebrew/opt/llvm@18/bin pkgs: bmake libarchive llvm@18 - - target_arch: amd64 - target: amd64 - - target_arch: aarch64 - target: arm64 + + - { target_arch: amd64, target: amd64 } + - { target_arch: i386, target: i386 } + - { target_arch: aarch64, target: arm64 } + - { target_arch: armv7, target: arm } + - { target_arch: powerpc, target: powerpc } + - { target_arch: powerpc64, target: powerpc } + - { target_arch: powerpc64le, target: powerpc } + - { target_arch: riscv64, target: riscv } steps: - uses: actions/checkout@v4 - name: install packages