-
Notifications
You must be signed in to change notification settings - Fork 2
142 lines (118 loc) · 4.27 KB
/
haskell-ci.yaml
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
136
137
138
139
140
name: Build
on:
- push
- pull_request
defaults:
run:
shell: bash
jobs:
main:
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc:
- "8.6"
- "8.8"
- "8.10"
- "9.0"
- "9.2"
- "9.4"
- "9.6"
- "9.8"
- "9.10"
include:
- os: macOS-latest
ghc: "9.10"
- os: windows-latest
ghc: "9.10"
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "latest"
cabal-update: true
- uses: actions/cache@v4
name: Cache cabal store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- name: Cabal version
run: |
cabal --version
- name: Unpack
run: |
cabal sdist --ignore-project --output-directory ..
cd ..
cabal get atomic-counter-*.tar.gz -d default
cabal get atomic-counter-*.tar.gz -d no-cmm
- name: Build & Test default
run: |
project_file="$(pwd)/cabal.project.ci"
cd ../default/atomic-counter-*/
cabal build --project-file "$project_file" all
cabal test --project-file "$project_file" --test-show-details=direct all
cabal bench --project-file "$project_file" --benchmark-options='--stdev 100 --timeout 100' all
- name: Haddock
run: |
cd ../default/atomic-counter-*/
cabal haddock all
- name: Cabal check
run: |
cd ../default/atomic-counter-*/
cabal check
- name: Build & Test no cmm
run: |
project_file="$(pwd)/cabal.project.ci"
cd ../no-cmm/atomic-counter-*/
cabal build --project-file "$project_file" --constraint "atomic-counter +no-cmm" all
cabal test --project-file "$project_file" --constraint "atomic-counter +no-cmm" --test-show-details=direct all
cabal bench --project-file "$project_file" --constraint "atomic-counter +no-cmm" --benchmark-options='--stdev 100 --timeout 100' all
wasi:
runs-on: ubuntu-latest
env:
GHC_WASM_META_REV: a04cc1a2206d2030326e1d49be9c6a94ee4283a3
strategy:
matrix:
ghc: ['9.10']
fail-fast: false
steps:
- name: setup-ghc-wasm32-wasi
run: |
cd $(mktemp -d)
curl -L https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/$GHC_WASM_META_REV/ghc-wasm-meta.tar.gz | tar xz --strip-components=1
./setup.sh
~/.ghc-wasm/add_to_github_path.sh
env:
FLAVOUR: ${{ matrix.ghc }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.ghc-wasm/.cabal/store
key: wasi-${{ runner.os }}-${{ env.GHC_WASM_META_REV }}-flavour-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: wasi-${{ runner.os }}-${{ env.GHC_WASM_META_REV }}-flavour-${{ matrix.ghc }}-
- name: Unpack
run: |
wasm32-wasi-cabal sdist --ignore-project --output-directory ..
cd ..
wasm32-wasi-cabal get atomic-counter-*.tar.gz -d default
wasm32-wasi-cabal get atomic-counter-*.tar.gz -d no-cmm
- name: Build & Test default
run: |
project_file="$(pwd)/cabal.project.ci"
cd ../default/atomic-counter-*/
wasm32-wasi-cabal build --project-file "$project_file" all
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" test:atomic-counter:test)
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" bench:atomic-counter:bench) --stdev 100 --timeout 100
- name: Build & Test no cmm
run: |
project_file="$(pwd)/cabal.project.ci"
cd ../no-cmm/atomic-counter-*/
wasm32-wasi-cabal build --project-file "$project_file" --constraint "atomic-counter +no-cmm" all
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" test:atomic-counter:test)
wasmtime.sh $(wasm32-wasi-cabal list-bin --project-file "$project_file" bench:atomic-counter:bench) --stdev 100 --timeout 100