-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.94 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Continuous integration
on: [push, pull_request]
env:
# Bump this number to invalidate the Github-actions cache
cache-invalidation-key: 0
nixpkgs-url: https://github.com/NixOS/nixpkgs/archive/7f9be6a505a31f88499c5d20d11f98accf5ae6ba.tar.gz
nix-cmd: nix-shell --pure --arg withDevTools "false" --run
jobs:
ormolu:
name: check formatting with ormolu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
with:
nix_path: "${{ env.nixpkgs-url }}"
- uses: cachix/cachix-action@v12
with:
name: aspiwack
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build Nix dependencies
run: ${{ env.nix-cmd }} "echo '=== Nix dependencies installed ==='"
- name: Check formatting
run: ${{ env.nix-cmd }} 'just format check'
test:
name: stack build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
with:
nix_path: "${{ env.nixpkgs-url }}"
- uses: cachix/cachix-action@v12
with:
name: aspiwack
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Cache Stack dependencies
uses: actions/cache@v3
with:
path: ~/.stack
key: stack-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'benign.cabal') }}-${{ github.sha }}
restore-keys: stack-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'benign.cabal') }}-
- name: Build Nix dependencies
run: ${{ env.nix-cmd }} "echo '=== Nix dependencies installed ==='"
- name: Build
run: ${{ env.nix-cmd }} "stack build --pedantic --test"