-
Notifications
You must be signed in to change notification settings - Fork 56
135 lines (117 loc) · 3.76 KB
/
haskell.yml
File metadata and controls
135 lines (117 loc) · 3.76 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Haskell CI
on:
push:
branches: [ '**' ]
pull_request:
branches: [ master ]
jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc:
# - "8.0.2"
# - "8.2.2"
# - "8.4.4"
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.3"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Cabal and GHC
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
- name: Cache Linux/Mac
uses: actions/cache@v3
if: ${{ matrix.os != 'windows-latest' }}
with:
path: ~/.cabal
key: -${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}-
restore-keys: |
-${{ runner.os }}-${{ matrix.ghc }}-build-
-${{ runner.os }}-
- name: Cache Windows
uses: actions/cache@v3
if: ${{ matrix.os == 'windows-latest' }}
with:
path: C:\sr\
# path: ~/AppData/Roaming/cabal
key: -${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}-
restore-keys: |
-${{ runner.os }}-${{ matrix.ghc }}-build-
-${{ runner.os }}-
- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks all
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test all
stack:
name: ${{ matrix.os }} / stack ${{ matrix.stack-resolver }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
stack-resolver:
- "--resolver nightly" # stack nightly
- "" # stack default
- "--resolver lts-19.16" # stack 9.0.2
- "--resolver lts-18.28" # stack 8.10.7
- "--resolver lts-18.8" # stack 8.10.6
- "--resolver lts-18.6" # stack 8.10.4
- "--resolver lts-17.2" # stack 8.10.3
- "--resolver lts-16.31" # stack 8.8.4
- "--resolver lts-16.11" # stack 8.8.3
- "--resolver lts-15.3" # stack 8.8.2
exclude:
- os: windows-latest
stack-resolver: "--resolver lts-18.8"
- os: windows-latest
stack-resolver: "--resolver lts-16.11"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Haskell Stack
uses: haskell/actions/setup@v2
with:
enable-stack: true
stack-no-global: true
- name: Cache MacOS
uses: actions/cache@v3
if: ${{ matrix.os == 'macOS-latest' }}
with:
path: ~/.stack
key: -${{ runner.os }}-${{ matrix.stack-resolver }}-
- name: Cache Ubuntu
uses: actions/cache@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
path: ~/.stack
key: -${{ runner.os }}-${{ matrix.stack-resolver }}-
- name: Cache Windows
uses: actions/cache@v3
if: ${{ matrix.os == 'windows-latest' }}
with:
path: C:\sr\
# path: ~\AppData\Local\Programs\stack
key: -${{ runner.os }}-${{ matrix.stack-resolver }}-
- name: Setup
run: |
stack setup ${{ matrix.stack-resolver }}
- name: Build
run: |
stack build ${{ matrix.stack-resolver }} --test --bench --no-run-tests --no-run-benchmarks
# Running with only one thread to avoid "openBinaryFile: resource busy (file is locked)"
- name: Test
run: |
stack test ${{ matrix.stack-resolver }} -j 1