-
Notifications
You must be signed in to change notification settings - Fork 22
95 lines (90 loc) · 2.84 KB
/
tests.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
name: Tests
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
# As of 21 October 2024, ubuntu-latest and windows-latest come with Stack 3.1.1.
# However, macos-13 and macos-latest do not come with Haskell tools.
jobs:
build:
name: CI
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
snapshot:
- stack-ghc-9.4.8.yaml
- stack-ghc-9.6.6.yaml
- stack-ghc-9.8.3.yaml
include:
- os: macos-13
snapshot: stack-ghc-9.8.3.yaml
# macos-latest provides macOS/AArch64 (M1)
- os: macos-latest
snapshot: stack-ghc-9.8.3.yaml
- os: windows-latest
snapshot: stack-ghc-9.8.3.yaml
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Cache dependencies on Unix-like OS
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }}
- name: Cache dependencies on Windows
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v4
with:
path: |
~\AppData\Roaming\stack
~\AppData\Local\Programs\stack
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }}
- name: Build and run tests
shell: bash
run: |
set -ex
if [[ "${{ matrix.os }}" == "macos-13" || "${{ matrix.os }}" == "macos-latest" ]]
then
# macos-13 and macos-latest do not include Haskell tools as at 2024-10-21.
curl -sSL https://get.haskellstack.org/ | sh
fi
stack --resolver ${{ matrix.snapshot }} test --bench --no-run-benchmarks --haddock --no-haddock-deps
test-pretty-exceptions:
name: Test build of test-pretty-exceptions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
snapshot:
- stack-ghc-9.8.3.yaml
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Cache dependencies on Unix-like OS
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }}-pretty
- name: Cache dependencies on Windows
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v4
with:
path: |
~\AppData\Roaming\stack
~\AppData\Local\Programs\stack
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.snapshot }}-pretty
- name: Build test-pretty-exceptions
shell: bash
run: |
set -ex
stack --resolver ${{ matrix.snapshot }} build --flag pantry:test-pretty-exceptions