accf961151
Also fix the run by setting up the environment in non-deprecated way. Always run with --debug to understand better what sort of stuff is happening in the background. Also split out the bmake bootstrap stage (takes about 31s on ubuntu, but 1m14 on macOS?) Drops the dependency on coreutils (realpath, nproc) and thus (?) fixes macOS to be just as fast (4 logical cores vs 2 physical cores before, go figure.) Reviewed by: arichardson
59 lines
2.3 KiB
YAML
59 lines
2.3 KiB
YAML
name: Cross-build Kernel
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.os }} (${{ matrix.compiler }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# TODO: both Ubuntu and macOS have bmake packages, we should try them instead of bootstrapping our own copy.
|
|
- os: ubuntu-20.04
|
|
compiler: clang-9
|
|
cross-bindir: /usr/lib/llvm-9/bin
|
|
pkgs: bmake libarchive-dev
|
|
- os: ubuntu-20.04
|
|
compiler: clang-10
|
|
cross-bindir: /usr/lib/llvm-10/bin
|
|
pkgs: bmake libarchive-dev
|
|
- os: macOS-latest
|
|
compiler: clang-11
|
|
#cross-bindir: /usr/local/Cellar/llvm/11.0.0/bin # script figures this out automatically
|
|
pkgs: bmake libarchive llvm@11
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: install packages (Ubuntu)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update --quiet || true
|
|
sudo apt-get -yq --no-install-suggests --no-install-recommends install ${{ matrix.pkgs }}
|
|
- name: install packages (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
brew update --quiet || true
|
|
brew install ${{ matrix.pkgs }}
|
|
- name: create environment
|
|
run: |
|
|
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
|
|
if [ -n "${{ matrix.cross-bindir }}" ]; then
|
|
echo "EXTRA_BUILD_ARGS=--cross-bindir=${{ matrix.cross-bindir }}" >> $GITHUB_ENV
|
|
fi
|
|
mkdir -p ../build
|
|
echo "MAKEOBJDIRPREFIX=${PWD%/*}/build" >> $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=amd64 TARGET_ARCH=amd64 -n
|
|
- name: make kernel-toolchain
|
|
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 kernel-toolchain -s -j$NPROC
|
|
- name: make buildkernel
|
|
run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=amd64 TARGET_ARCH=amd64 KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS
|