mirror of
https://github.com/opnsense/src.git
synced 2026-05-18 03:59:39 -04:00
GitHub removed Clang 9 from the 20.04 image[1], breaking this build. Thus, manually add the specific versioned packages we need for the Ubuntu jobs to ensure they're installed. Note that we don't do the same for macOS, as Homebrew does not allow multiple llvm@N to co-exist, giving an error if you attempt to install a second one. In practice we don't actually use the compiler field here for anything other than the build name, it's only the cross-bindir that matters, so when it eventually moves to 12 the name will get confusing but the job will still work. MFC after: immediately [1]15a610677b(cherry picked from commite5f5b6a75c)
57 lines
2.2 KiB
YAML
57 lines
2.2 KiB
YAML
name: Cross-build Kernel
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, 'stable/13' ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
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 clang-9 lld-9
|
|
- os: ubuntu-20.04
|
|
compiler: clang-10
|
|
cross-bindir: /usr/lib/llvm-10/bin
|
|
pkgs: bmake libarchive-dev clang-10 lld-10
|
|
- os: macOS-latest
|
|
compiler: clang-11
|
|
pkgs: bmake libarchive
|
|
|
|
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 }} || true
|
|
- 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
|