Skip to content

Preserve exit status of nix develop #47

Preserve exit status of nix develop

Preserve exit status of nix develop #47

Workflow file for this run

on:
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
list-determinate-shells:
runs-on: ubuntu-22.04
outputs:
shells: ${{ steps.shells.outputs.shells }}
steps:
- uses: cachix/install-nix-action@v30
- id: shells
run: |
echo "shells=$(nix eval github:DeterminateSystems/zero-to-nix#devShells.x86_64-linux --apply builtins.attrNames --json)" >> "$GITHUB_OUTPUT"
test-determinate-shells:
needs:
- list-determinate-shells
runs-on: ubuntu-22.04
strategy:
matrix:
shell: ${{ fromJSON(needs.list-determinate-shells.outputs.shells) }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: ./
with:
arguments: github:DeterminateSystems/zero-to-nix#${{ matrix.shell }}
test-self:
strategy:
matrix:
runs-on:
- ubuntu-22.04
- macos-13
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: ./
- name: Make the nix command fail
uses: ./
with:
arguments: --a-bad-flag
id: should-fail
continue-on-error: true
- name: Fail if the action succeeded when the nix command failed
if: steps.should-fail.outcome == 'success'
run: exit 1
check:
strategy:
matrix:
runs-on:
- ubuntu-22.04
- macos-13
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- run: nix flake check --keep-going --print-build-logs --show-trace