Skip to content

Commit

Permalink
Merge pull request #53 from DeterminateSystems/test-fail-mode
Browse files Browse the repository at this point in the history
Add strict mode
  • Loading branch information
lucperkins committed May 22, 2024
2 parents a47252d + f7b3d96 commit 6022588
Show file tree
Hide file tree
Showing 7 changed files with 1,152 additions and 792 deletions.
73 changes: 24 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- run: git diff --exit-code

test-no-nix:
needs: build
name: "Test: Nix not installed"
runs-on: ubuntu-22.04
permissions:
Expand All @@ -43,9 +44,12 @@ jobs:
- uses: actions/checkout@v4
- name: Cache the store
uses: ./
with:
_internal-strict-mode: true

run-x86_64-linux-untrusted:
name: Run x86_64 Linux, Untrusted
needs: build
name: Run x86_64-linux, Untrusted
runs-on: ubuntu-22.04
permissions:
id-token: "write"
Expand All @@ -63,73 +67,44 @@ jobs:
trusted-users = root
- name: Cache the store
uses: ./
with:
_internal-strict-mode: true
- name: Check the cache isn't enabled
run: |
[ $(nix config show substituters) == "https://cache.nixos.org/" ]
run-x86_64-linux:
name: Run x86_64 Linux
runs-on: ubuntu-22.04
run-systems:
needs: build
name: "Run ${{ matrix.systems.nix-system }}"
runs-on: "${{ matrix.systems.runner }}"
permissions:
id-token: "write"
contents: "read"
env:
ACTIONS_STEP_DEBUG: true
strategy:
matrix:
systems:
- nix-system: "aarch64-darwin"
runner: "macos-latest-xlarge"
- nix-system: "x86_64-darwin"
runner: "macos-12"
- nix-system: "aarch64-linux"
runner: "namespace-profile-default-arm64"
- nix-system: "x86_64-linux"
runner: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
- name: Install Nix
- name: Install Nix on ${{ matrix.systems.nix-system }} system
uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
extra-conf: |
narinfo-cache-negative-ttl = 0
- name: Cache the store
uses: ./
- name: Check the cache for liveness
run: |
.github/workflows/cache-test.sh
run-x86_64-darwin:
name: Run x86_64 Darwin
runs-on: macos-12
permissions:
id-token: "write"
contents: "read"
env:
ACTIONS_STEP_DEBUG: true
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
extra-conf: |
narinfo-cache-negative-ttl = 0
- name: Cache the store
uses: ./
- name: Check the cache for liveness
run: |
.github/workflows/cache-test.sh
run-aarch64-darwin:
name: Run aarch64 Darwin
concurrency: build-ARM64-macOS
runs-on: macos-latest-xlarge
permissions:
id-token: "write"
contents: "read"
env:
ACTIONS_STEP_DEBUG: true
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
extra-conf: |
narinfo-cache-negative-ttl = 0
- name: Cache the store
uses: ./
_internal-strict-mode: true
- name: Check the cache for liveness
run: |
.github/workflows/cache-test.sh
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ inputs:
source-url:
description: A URL pointing to a `magic-nix-cache` binary. Overrides all other `source-*` options.
required: false
_internal-strict-mode:
description: Whether to fail when any errors are thrown. Used only to test the Action; do not set this in your own workflows.
default: false

runs:
using: "node20"
Expand Down
Loading

0 comments on commit 6022588

Please sign in to comment.