-
-
Notifications
You must be signed in to change notification settings - Fork 11
60 lines (50 loc) · 1.37 KB
/
Copy pathtest.yml
File metadata and controls
60 lines (50 loc) · 1.37 KB
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
51
52
53
54
55
56
57
58
59
60
name: "Test"
on:
pull_request:
branches:
- main
paths:
- "core/**"
- "cli/**"
- "nix/**"
push:
branches:
- main
paths:
- "core/**"
- "cli/**"
- "nix/**"
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install current Bash on macOS
if: runner.os == 'macOS'
run: brew install bash
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- name: Build the project with Nix
run: nix-build
- name: Cache Cabal
id: cache
uses: actions/cache@v4
with:
path: |
~/.cabal
dist-newstyle
.devenv/profile
key: ${{ runner.os }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/*.lock') }}-1 # modify the key if the cache is not working as expected
- name: Update Cabal Hackage list
# if: steps.cache.outputs.cache-hit != 'true'
run: nix-shell --run "cabal update"
- name: Build the project with cabal
run: nix-shell --run "cabal build all"
- name: Run core tests
run: nix-shell --run "cabal test core"
- name: Run core doctests
run: nix-shell --run "run-doctests-verbose"
- name: Run CLI tests
run: nix-shell --run "cabal test cli"