name: CI on: push: branches: [master] # Only the newest commit is worth building and caching concurrency: group: ci cancel-in-progress: true jobs: check: name: Check, build and cache nixfiles runs-on: ubuntu-26.04 steps: - uses: actions/checkout@v6 - uses: DeterminateSystems/determinate-nix-action@v3 with: # Gitea will supply a token in GITHUB_TOKEN, which this action passes to # Nix (as access-tokens) when downloading from GitHub github-token: ${{ secrets.GH_PULL_TOKEN }} extra-conf: | # Make sure we're using sandbox sandbox-fallback = false # Big C++ projects fill up memory... cores = 6 # Determinate performance features lazy-trees = true eval-cores = 0 accept-flake-config = true extra-substituters = https://nix-cache.nul.ie extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4= - name: Check flake id: ifd run: | reasons="$(nix eval --option allow-import-from-derivation false --json .#ciIfdReasons.x86_64-linux)" required="$(jq -r 'length > 0' <<< "$reasons")" echo "required=$required" >> "$GITHUB_OUTPUT" if [[ "$required" == true ]]; then jq -r '.[] | "::warning::\(.). The flake check will run after the target builds."' <<< "$reasons" else nix flake check --no-build --option allow-import-from-derivation false fi - name: Build (and cache) the world id: build env: HARMONIA_SSH_KEY: ${{ secrets.HARMONIA_SSH_KEY }} CI_IFD_REQUIRED: ${{ steps.ifd.outputs.required }} run: >- nix shell .#nixpkgs.unstable.x86_64-linux.python3 .#nixpkgs.unstable.x86_64-linux.nix-eval-jobs --command python3 ci/build-and-cache.py