@@ -39,13 +39,17 @@ jobs:
39
39
~/.stack/pantry
40
40
~/.stack/indices
41
41
key : ${{ runner.os }}-stack-pantry-${{ hashFiles('stack.yaml') }}-v1
42
-
42
+ restore-keys : |
43
+ ${{ runner.os }}-stack-pantry-
44
+
43
45
# Cache global stack programs
44
46
- name : Cache Stack programs
45
47
uses : actions/cache@v3
46
48
with :
47
49
path : ~/.stack/programs
48
50
key : ${{ runner.os }}-stack-programs-${{ hashFiles('stack.yaml') }}-v1
51
+ restore-keys : |
52
+ ${{ runner.os }}-stack-programs-
49
53
50
54
# Cache project dependencies
51
55
- name : Cache Stack project dependencies
@@ -66,13 +70,10 @@ jobs:
66
70
run : stack setup --install-ghc
67
71
68
72
- name : Install dependencies
69
- run : |
70
- stack build --only-dependencies --test --bench --no-run-benchmarks
73
+ run : stack build --only-dependencies --test --bench --no-run-benchmarks
71
74
72
75
- name : Build
73
- run : |
74
- stack build --test --bench --no-run-benchmarks --pedantic
75
- # --pedantic turns warnings into errors
76
+ run : stack build --test --bench --no-run-benchmarks
76
77
77
78
- name : Run tests
78
79
run : |
@@ -90,11 +91,10 @@ jobs:
90
91
stack exec -- ormolu --mode check $(find . -name '*.hs')
91
92
92
93
- name : Build documentation
93
- run : |
94
- stack haddock --no-haddock-deps
95
- # Optional: deploy docs to GitHub Pages
94
+ run : stack haddock --no-haddock-deps
96
95
97
- - name : Run benchmarkse
96
+ - name : Run benchmarks
97
+ if : github.event_name == 'pull_request' # Only run benchmarks on PRs
98
98
run : stack bench
99
99
100
100
- name : Upload test results
@@ -107,8 +107,6 @@ jobs:
107
107
.stack-work/dist/**/hpc/
108
108
.stack-work/dist/**/doc/
109
109
110
-
111
-
112
110
concurrency :
113
111
group : ${{ github.workflow }}-${{ github.ref }}
114
112
cancel-in-progress : true
0 commit comments