1 name: Cross-build Kernel
5 branches: [ main, 'stable/14', 'stable/13' ]
14 name: ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }})
15 runs-on: ${{ matrix.os }}
19 target_arch: [ amd64, aarch64 ]
20 os: [ ubuntu-20.04, ubuntu-22.04, macos-latest ]
22 # TODO: both Ubuntu and macOS have bmake packages, we should try them instead of bootstrapping our own copy.
25 cross-bindir: /usr/lib/llvm-12/bin
26 pkgs: bmake libarchive-dev clang-12 lld-12
29 cross-bindir: /usr/lib/llvm-14/bin
30 pkgs: bmake libarchive-dev clang-14 lld-14
33 cross-bindir: /usr/local/opt/llvm@13/bin
34 pkgs: bmake libarchive llvm@13
37 - target_arch: aarch64
40 - uses: actions/checkout@v3
41 - name: install packages (Ubuntu)
42 if: runner.os == 'Linux'
44 sudo apt-get update --quiet || true
45 sudo apt-get -yq --no-install-suggests --no-install-recommends install ${{ matrix.pkgs }}
46 - name: install packages (macOS)
47 if: runner.os == 'macOS'
49 brew update --quiet || true
50 brew install ${{ matrix.pkgs }} || true
51 - name: create environment
53 echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
54 if [ -n "${{ matrix.cross-bindir }}" ]; then
55 echo "EXTRA_BUILD_ARGS=--cross-bindir=${{ matrix.cross-bindir }}" >> $GITHUB_ENV
58 echo "MAKEOBJDIRPREFIX=${PWD%/*}/build" >> $GITHUB_ENV
59 # heh, works on Linux/BSD/macOS ...
60 echo "NPROC=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`" >> $GITHUB_ENV
61 - name: bootstrap bmake
62 run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} -n
63 - name: make kernel-toolchain
64 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
65 - name: make buildkernel
66 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