2023-11-16 22:00:49 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
2024-11-30 18:05:22 +00:00
|
|
|
name: Check, build and cache nixfiles
|
2023-11-16 22:00:49 +00:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-06-30 13:10:23 +01:00
|
|
|
- uses: cachix/install-nix-action@v27
|
2023-11-16 23:50:17 +00:00
|
|
|
with:
|
|
|
|
# Gitea will supply a token in GITHUB_TOKEN, which this action will
|
|
|
|
# try to pass to Nix when downloading from GitHub
|
|
|
|
github_access_token: ${{ secrets.GH_PULL_TOKEN }}
|
|
|
|
extra_nix_config: |
|
|
|
|
# Make sure we're using sandbox
|
|
|
|
sandbox-fallback = false
|
2024-06-30 13:10:23 +01:00
|
|
|
# Big C++ projects fill up memory...
|
|
|
|
cores = 6
|
2023-11-17 22:57:44 +00:00
|
|
|
|
2024-07-20 16:46:10 +01:00
|
|
|
extra-substituters = https://nix-cache.nul.ie
|
|
|
|
extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4=
|
2023-11-16 22:00:49 +00:00
|
|
|
|
2023-11-17 23:47:11 +00:00
|
|
|
- name: Check flake
|
2024-11-26 12:29:44 +00:00
|
|
|
run: nix flake check --no-build
|
2024-11-30 18:05:22 +00:00
|
|
|
|
2024-11-26 12:29:44 +00:00
|
|
|
- name: Build (and cache) the world
|
2023-11-17 15:39:31 +00:00
|
|
|
id: build
|
2024-07-20 16:46:10 +01:00
|
|
|
env:
|
|
|
|
HARMONIA_SSH_KEY: ${{ secrets.HARMONIA_SSH_KEY }}
|
2023-11-17 15:05:19 +00:00
|
|
|
run: |
|
2024-11-26 12:29:44 +00:00
|
|
|
nix eval --json --apply "builtins.attrNames" .#ci.x86_64-linux | jq -cr '.[]' | while read job; do
|
2024-11-30 18:05:22 +00:00
|
|
|
echo "::group::Build $job"
|
2024-11-26 22:45:19 +00:00
|
|
|
nix build --no-link .#ci.x86_64-linux."$job"
|
2024-11-30 18:05:22 +00:00
|
|
|
echo "::endgroup::"
|
2024-11-26 22:45:19 +00:00
|
|
|
|
2024-11-30 18:05:22 +00:00
|
|
|
echo "::group::Cache $job"
|
2024-11-26 22:45:19 +00:00
|
|
|
ci/push-to-cache.sh "$(nix eval --raw .#ci.x86_64-linux."$job")"
|
2024-11-30 18:05:22 +00:00
|
|
|
echo "::endgroup::"
|
2024-11-26 12:29:44 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "Building and caching CI derivation"
|
2024-11-26 22:45:19 +00:00
|
|
|
nix build --no-link .#ciDrv.x86_64-linux
|
|
|
|
UPDATE_PROFILE=1 ci/push-to-cache.sh "$(nix eval --raw .#ciDrv.x86_64-linux)"
|