2021-02-11 20:55:45 +01:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-11-17 06:56:28 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-04-22 22:15:05 +02:00
|
|
|
include:
|
|
|
|
- label: x86_64-linux
|
2022-08-17 04:15:43 +02:00
|
|
|
image: ubuntu-latest
|
2023-04-22 22:15:05 +02:00
|
|
|
- label: aarch64-linux
|
|
|
|
image: ubuntu-latest
|
|
|
|
system: aarch64-linux
|
|
|
|
- label: x86_64-darwin
|
2022-08-19 01:38:01 +02:00
|
|
|
image: macos-12
|
2022-08-17 04:15:43 +02:00
|
|
|
|
2023-04-22 22:15:05 +02:00
|
|
|
name: ${{ matrix.label }}
|
|
|
|
runs-on: ${{ matrix.image }}
|
2021-02-11 20:55:45 +01:00
|
|
|
steps:
|
2023-01-28 07:44:41 +01:00
|
|
|
- uses: actions/checkout@v3.3.0
|
2022-08-17 04:15:43 +02:00
|
|
|
|
2023-01-28 07:44:41 +01:00
|
|
|
- name: Install Nix
|
2023-10-18 23:41:54 +02:00
|
|
|
uses: DeterminateSystems/nix-installer-action@9b252454a8d70586c4ee7f163bf4bb1e9de3d763 # v2
|
2021-11-22 20:20:41 +01:00
|
|
|
|
2023-04-22 22:15:05 +02:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2.1.0
|
|
|
|
if: matrix.system != ''
|
|
|
|
|
|
|
|
- name: Generate System Flags
|
|
|
|
run: |
|
|
|
|
LOCAL_SYSTEM=$(nix-instantiate --eval --json -E 'builtins.currentSystem' | jq -r)
|
|
|
|
HOST_SYSTEM=${HOST_SYSTEM:-$LOCAL_SYSTEM}
|
|
|
|
if [[ "$LOCAL_SYSTEM" != "$HOST_SYSTEM" ]]; then
|
|
|
|
echo "system_flags=--system $HOST_SYSTEM" >>"$GITHUB_ENV"
|
|
|
|
echo "extra-platforms = $HOST_SYSTEM" | sudo tee -a /etc/nix/nix.conf
|
|
|
|
fi
|
|
|
|
env:
|
|
|
|
HOST_SYSTEM: '${{ matrix.system }}'
|
|
|
|
|
2021-11-22 20:20:41 +01:00
|
|
|
- name: Enable Binary Cache
|
2023-01-28 07:44:41 +01:00
|
|
|
uses: cachix/cachix-action@v12
|
2021-11-18 07:21:00 +01:00
|
|
|
with:
|
|
|
|
name: colmena
|
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
2021-06-29 10:02:43 +02:00
|
|
|
|
2021-11-17 06:56:28 +01:00
|
|
|
- name: Build Colmena
|
2023-04-22 22:15:05 +02:00
|
|
|
run: nix build -L $system_flags
|
2021-09-20 07:03:39 +02:00
|
|
|
|
2021-11-18 07:21:00 +01:00
|
|
|
- name: Build manual
|
|
|
|
run: nix build .#manual -L
|