Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Bump cachix/install-nix-action from 22 to 23 (#196) #642

Bump cachix/install-nix-action from 22 to 23 (#196)

Bump cachix/install-nix-action from 22 to 23 (#196) #642

name: Build and test
on:
push:
branches:
- main
- dev
pull_request:
jobs:
build-and-run-tests:
name: Build & run tests
runs-on: ubuntu-latest
steps:
- name: Check out repository code.
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
## Example from
## https://github.com/actions/cache/blob/ac25611caef967612169ab7e95533cf932c32270/examples.md#haskell---cabal
- name: Accessing the cabal cache
uses: actions/cache@v3
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ hashFiles('pirouette.cabal', 'cabal.project') }}]
restore-keys: ${{ runner.os }}-
- name: Build and test pirouette
run: nix develop .#ci --command bash tests/run-tests.sh --ci
- name: Upload tests results as artifacts
uses: actions/upload-artifact@v3
with:
name: pirouette-checks
path: |
./*.out
./*.res
check-result:
needs: build-and-run-tests
name: Check tests output
runs-on: ubuntu-latest
steps:
- name: Access tests output
uses: actions/download-artifact@v3
with:
name: pirouette-checks
- name: Check output
run: |
echo "!! CABAL TEST OUTPUT:"
cat pirouette-cabal-test.out
cabal_res=$(cat pirouette-cabal-test.res | cut -d':' -f2)
run-flake-checks:
name: Run flake checks
runs-on: ubuntu-latest
steps:
- name: Check out repository code.
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Run flake checks
run: nix flake check --print-build-logs