release: 0.12.0 #107
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration (Nix) | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- ci | |
pull_request: | |
merge_group: | |
# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel | |
# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
nix: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get more space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- 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 | |
- name: Restore and save Nix store | |
uses: nix-community/cache-nix-action@v6 | |
with: | |
# restore and save a cache using this key | |
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} | |
# if there's no cache hit, restore a cache by this prefix | |
restore-prefixes-first-match: nix-${{ runner.os }}- | |
# collect garbage until the Nix store size (in bytes) is at most this number | |
# before trying to save a new cache | |
# 1G = 1073741824 | |
gc-max-store-size-linux: 6G | |
# do purge caches | |
purge: true | |
# purge all versions of the cache | |
purge-prefixes: nix-${{ runner.os }}- | |
# created more than this number of seconds ago | |
purge-created: 0 | |
# or, last accessed more than this number of seconds ago | |
# relative to the start of the `Post Restore and save Nix store` phase | |
purge-last-accessed: 0 | |
# except any version with the key that is the same as the `primary-key` | |
purge-primary-key: never | |
# Build and test tracexec | |
# Also builds kernels | |
- run: nix build | |
# Run Userspace<->Kernel CI | |
- run: nix run '.#ukci' | |
- name: Add gc root for UKCI | |
run: ln -s "$(nix eval --raw '.#ukci')" /nix/var/nix/gcroots/ukci |