mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
22f731486e
Homebrew has added LLVM 14 and made that the default version, but GitHub continues to install LLVM 13 for now, so it ends up only accessible via the versioned name and not the unversioned one. We also add an explicit installation of llvm@13 so that, if GitHub updates the image to using LLVM 14, the action continues to work, albeit slightly more slowly. This also ensures the compiler label remains correct rather than outdated, as has occurred in the past, and that we don't get new versions of LLVM before we're ready for them, which is especially relevant for stable branches. This all mirrors how the Ubuntu jobs are configured.
64 lines
2.6 KiB
YAML
64 lines
2.6 KiB
YAML
name: Cross-build Kernel
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, 'stable/13' ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target_arch: [ amd64, aarch64 ]
|
|
os: [ ubuntu-20.04, ubuntu-22.04, macos-latest ]
|
|
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-12
|
|
cross-bindir: /usr/lib/llvm-12/bin
|
|
pkgs: bmake libarchive-dev clang-12 lld-12
|
|
- os: ubuntu-22.04
|
|
compiler: clang-14
|
|
cross-bindir: /usr/lib/llvm-14/bin
|
|
pkgs: bmake libarchive-dev clang-14 lld-14
|
|
- os: macos-latest
|
|
compiler: clang-13
|
|
cross-bindir: /usr/local/opt/llvm@13/bin
|
|
pkgs: bmake libarchive llvm@13
|
|
- target_arch: amd64
|
|
target: amd64
|
|
- target_arch: aarch64
|
|
target: arm64
|
|
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=${{ matrix.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
|
|
- 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
|