Skip to content

cache-nixos-test #450

cache-nixos-test

cache-nixos-test #450

Workflow file for this run

name: cache-nixos-test
on:
push:
branches:
- main
pull_request:
branches:
- "*"
schedule:
- cron: "05 */6 * * *"
workflow_dispatch:
jobs:
without-caching:
runs-on:
- nscloud-ubuntu-22.04-amd64-4x16
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
system-features = kvm nixos-test
- name: Build a package
run: |
nix develop --accept-flake-config -c pre-commit run
with-ns-cache-volume:
runs-on:
# Replace with your profile label https://namespace.so/docs/features/faster-github-actions#using-runner-profiles
- namespace-profile-amd64-with-caching
steps:
- uses: actions/checkout@v4
- name: Set up Nix cache
uses: namespacelabs/nscloud-cache-action@v1
with:
path: /nix
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
system-features = kvm nixos-test
- name: Build a package
run: |
nix develop --accept-flake-config -c pre-commit run
with-magic-nix-cache:
runs-on:
- nscloud-ubuntu-22.04-amd64-4x16
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
system-features = kvm nixos-test
- name: Set up Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Build a package
run: |
nix develop --accept-flake-config -c pre-commit run
# DeterminateSystems/nix-installer-action doesn't support nscloud cache.
# https://namespacelabs.slack.com/archives/C052BNWAFLL/p1709047110830379
#
# with-ns-cache-volume-determinatesystems-installer:
# runs-on:
# - namespace-profile-amd64-with-caching
# steps:
# - uses: actions/checkout@v4
# - name: Set up Nix cache
# run: |
# sudo mkdir -p /cache/nix /nix
# sudo mount --bind /cache/nix /nix
# sudo chown runner /nix
# # the nix-installer-action doesn't recreate /etc/nix/* when nix
# # appears to be already installed, so we want to preserve nix's configuration files
# sudo mkdir -p /cache/etc-nix /etc/nix
# sudo mount --bind /cache/etc-nix /etc/nix
# - name: Install Nix
# uses: DeterminateSystems/nix-installer-action@v6
# with:
# init: none
# github-token: null
# - name: Allows user runner to run nix
# run: |
# sudo chown -R runner:runner /nix/var/nix /nix/var/log /nix/store
# - name: Build a package
# run: |
# nix develop --accept-flake-config -c pre-commit run