Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
VexedUXR committed Dec 2, 2024
1 parent e1e0f28 commit 3e486ff
Showing 1 changed file with 65 additions and 8 deletions.
73 changes: 65 additions & 8 deletions .github/workflows/cross-bootstrap-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 all amd64 i386 arm64 arm powerpc riscv
do
files="sys/conf/files.$t"
if [ "$t" = "amd64" ] || [ "$t" = "i386" ]; then
files="$files sys/conf/files.x86"
elif [ "$t" = "all" ]; then
files="sys/conf/files"
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/_-]*\.[cmS]' | sed 's;[^ ]*;"sys/&",;g')]" >> $filters
done
echo 'powerpc64: *powerpc' >> $filters
echo 'powerpc64le: *powerpc' >> $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.
Expand All @@ -33,10 +83,6 @@ 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
steps:
- uses: actions/checkout@v4
- name: install packages
Expand All @@ -54,11 +100,22 @@ jobs:
fi
mkdir -p ../build
echo "MAKEOBJDIRPREFIX=${PWD%/*}/build" >> $GITHUB_ENV
case "${{ matrix.target_arch }}" in
"aarch64") t="aarch64";;
"armv7") t="armv7";;
"powerpc64") t="powerpc";;
"powerpc64le") t="powerpc";;
"riscv64") t="riscv";;
*) t="${{ matrix.target_arch }}";;
esac
echo "TARGET=$t" >> $GITHUB_ENV
# heh, works on Linux/BSD/macOS ...
echo "NPROC=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`" >> $GITHUB_ENV
- name: bootstrap bmake
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} -n
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=$TARGET TARGET_ARCH=${{ matrix.target_arch }} -n
- name: make kernel-toolchain
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} kernel-toolchain -s -j$NPROC -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=$TARGET TARGET_ARCH=${{ matrix.target_arch }} kernel-toolchain -s -j$NPROC -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP
- name: make buildkernel
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=$TARGET TARGET_ARCH=${{ matrix.target_arch }} KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS

0 comments on commit 3e486ff

Please sign in to comment.