name: Continuous Integration (Nix)
permissions:
contents: read
on:
workflow_dispatch:
push:
branches:
- main
- ci
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get update -y
sudo apt-get install -y qemu-kvm
- uses: nixbuild/nix-quick-install-action@v30
with:
nix_conf: |
keep-env-derivations = true
keep-outputs = true
http2 = false
- name: Setup Attic cache (Writable)
uses: ryanccn/attic-action@v0.4.1
if: github.event.pull_request.head.repo.fork != true
with:
endpoint: https://nix.kxxt.dev
cache: tracexec
token: ${{ secrets.NIX_CACHE_JWT }}
- name: Setup Attic cache (ReadOnly)
uses: ryanccn/attic-action@v0.4.1
if: github.event.pull_request.head.repo.fork == true
with:
endpoint: https://nix.kxxt.dev
cache: tracexec
skip-push: true
- run: nix build
- run: nix run '.#ukci'
- name: Add gc root for UKCI
run: ln -s "$(nix eval --raw '.#ukci')" /nix/var/nix/gcroots/ukci