xref: /freebsd/.github/workflows/cross-bootstrap-tools.yml (revision a521f2116473fbd8c09db395518f060a27d02334)
1name: Cross-build CI
2
3on:
4  push:
5    branches: [ master ]
6  pull_request:
7    branches: [ master ]
8
9jobs:
10  build:
11    name: ${{ matrix.os }}
12    runs-on: ${{ matrix.os }}
13    strategy:
14      matrix:
15        os: [ubuntu-18.04, ubuntu-20.04, macOS-latest]
16
17    steps:
18      - uses: actions/checkout@v2
19      - name: install LLVM+libarchive (Ubuntu)
20        run: |
21          wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh
22          chmod +x /tmp/llvm.sh
23          sudo /tmp/llvm.sh 11
24          sudo apt install -y libarchive-dev
25          echo "::set-env name=EXTRA_MAKE_ARGS::--cross-bindir=/usr/lib/llvm-11/bin"
26        if: ${{ startsWith(matrix.os, 'ubuntu') }}
27      - name: install LLVM+libarchive (macOS)
28        run: brew install llvm coreutils libarchive xz
29        if: ${{ startsWith(matrix.os, 'macOS') }}
30      - name: create build dir
31        run: rm -rf ../build && mkdir -p ../build
32      - name: make kernel-toolchain
33        run: env MAKEOBJDIRPREFIX=`realpath ../build` ./tools/build/make.py $EXTRA_MAKE_ARGS TARGET=amd64 TARGET_ARCH=amd64 kernel-toolchain -s -j$(nproc)
34      - name: make buildkernel
35        run: env MAKEOBJDIRPREFIX=`realpath ../build` ./tools/build/make.py $EXTRA_MAKE_ARGS TARGET=amd64 TARGET_ARCH=amd64 KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$(nproc)
36