2021-02-11 11:55:45 -08:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-11-16 21:56:28 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-04-22 14:15:05 -06:00
|
|
|
include:
|
|
|
|
- label: x86_64-linux
|
2022-08-16 20:15:43 -06:00
|
|
|
image: ubuntu-latest
|
2023-04-22 14:15:05 -06:00
|
|
|
- label: aarch64-linux
|
|
|
|
image: ubuntu-latest
|
|
|
|
system: aarch64-linux
|
|
|
|
- label: x86_64-darwin
|
2022-08-18 17:38:01 -06:00
|
|
|
image: macos-12
|
2022-08-16 20:15:43 -06:00
|
|
|
|
2023-04-22 14:15:05 -06:00
|
|
|
name: ${{ matrix.label }}
|
|
|
|
runs-on: ${{ matrix.image }}
|
2021-02-11 11:55:45 -08:00
|
|
|
steps:
|
2023-01-27 23:44:41 -07:00
|
|
|
- uses: actions/checkout@v3.3.0
|
2022-08-16 20:15:43 -06:00
|
|
|
|
2023-01-27 23:44:41 -07:00
|
|
|
- name: Install Nix
|
2023-02-06 17:48:29 -07:00
|
|
|
uses: DeterminateSystems/nix-installer-action@e1f2e54ff90b012560f19481e250bb7d909f3acd
|
2021-11-22 11:20:41 -08:00
|
|
|
|
2023-04-22 14:15:05 -06: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 11:20:41 -08:00
|
|
|
- name: Enable Binary Cache
|
2023-01-27 23:44:41 -07:00
|
|
|
uses: cachix/cachix-action@v12
|
2021-11-17 22:21:00 -08:00
|
|
|
with:
|
|
|
|
name: colmena
|
|
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
2021-06-29 01:02:43 -07:00
|
|
|
|
2021-11-16 21:56:28 -08:00
|
|
|
- name: Build Colmena
|
2023-04-22 14:15:05 -06:00
|
|
|
run: nix build -L $system_flags
|
2021-09-19 22:03:39 -07:00
|
|
|
|
2021-11-17 22:21:00 -08:00
|
|
|
- name: Build manual
|
|
|
|
run: nix build .#manual -L
|