-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (107 loc) · 4.19 KB
/
haskell.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
name: Haskell CI
on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master
jobs:
build_and_test:
strategy:
matrix:
# os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest]
plan:
- {resolver: ""}
include:
- os: ubuntu-latest
apt-get: graphviz texlive-base texlive-latex-base
runs-on: ${{ matrix.os }}
steps:
- name: Install ${{ matrix.os }} Packages
uses: mstksg/get-package@2a4b48d55d72d43ca89ae58ec9ca1397d34a1c35
with:
apt-get: ${{ matrix.apt-get }}
- uses: actions/checkout@v4
- name: Cache Stack on unix
id: cache-stack-unix
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
save-always: true
restore-keys: |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}
${{ runner.os }}-stack-global-
if: contains(matrix.os, 'windows') == false
- name: Cache Stack on windows
id: cache-stack-windows
uses: actions/cache@v4
with:
path: ~/AppData/Local/Programs/stack
key: ${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
save-always: true
restore-keys: |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}
${{ runner.os }}-stack-global-
if: contains(matrix.os, 'windows')
- uses: actions/cache@v4
name: Cache .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}
${{ runner.os }}-stack-work-${{ matrix.plan.resolver }}
${{ runner.os }}-stack-work-
- name: Setup stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
- name: Install dependencies on unix
run: |
set -ex
# shellcheck disable=SC2086
stack --no-terminal --install-ghc $ARGS test --stack-yaml=stack-apps.yaml --bench --only-dependencies
set +ex
env:
ARGS: ${{ matrix.plan.resolver }}
if: contains(matrix.os, 'windows') == false
- name: Install dependencies on windows
shell: powershell
run: |
stack --no-terminal --install-ghc ${env:ARGS} test --stack-yaml=stack-apps.yaml --bench --only-dependencies
env:
ARGS: ${{ matrix.plan.resolver }}
if: contains(matrix.os, 'windows')
- name: Build and test on unix
id: test-unix
run: |
set -ex
# shellcheck disable=SC2086
stack --no-terminal $ARGS test --stack-yaml=stack-apps.yaml --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps --test-arguments="--maximum-generated-tests=50"
set +ex
env:
ARGS: ${{ matrix.plan.resolver }}
if: contains(matrix.os, 'windows') == false
- name: Build and test on windows
id: test-windows
shell: powershell
run: |
stack --no-terminal ${env:ARGS} test --stack-yaml=stack-apps.yaml --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps --test-arguments="--maximum-generated-tests=50"
env:
ARGS: ${{ matrix.plan.resolver }}
if: contains(matrix.os, 'windows')
- name: Archive test artifacts
uses: actions/upload-artifact@v4
with:
name: test-results
path: artifacts
if: ${{ failure() && (steps.test-unix.conclusion == 'failure' || steps.test-windows.conclusion == 'failure') }}