-
Notifications
You must be signed in to change notification settings - Fork 0
233 lines (199 loc) · 6.78 KB
/
ci.yaml
File metadata and controls
233 lines (199 loc) · 6.78 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
name: ci
on:
push:
branches:
- main
- release
pull_request:
branches:
- main
workflow_dispatch:
env:
CABAL_VERS: "3.12"
GHC_VERS: "9.12.2"
CABAL_PROJ: "cabal.ghc9122.project"
CHARON_VERS: "0.1"
jobs:
cabal:
strategy:
fail-fast: false
matrix:
ghc:
- vers: "9.6.6"
proj_file: ""
- vers: "9.8.4"
proj_file: ""
- vers: "9.10.2"
proj_file: ""
- vers: "9.12.2"
proj_file: "--project-file cabal.ghc9122.project"
platform:
- os: "macos-latest"
unit-trials: 10000
int-trials: 1000
- os: "ubuntu-latest"
unit-trials: 10000
int-trials: 1000
- os: "windows-latest"
unit-trials: 1000
int-trials: 1000
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc.vers }}
- name: Configure
run: cabal configure ${{ matrix.ghc.proj_file }} --enable-tests --enable-benchmarks --ghc-options -Werror
- name: Compile
run: cabal build ${{ matrix.ghc.proj_file }} charon:exe:charon
- name: Unit Tests
id: unit
run: |
cabal test ${{ matrix.ghc.proj_file }} unit --test-options '--hedgehog-tests ${{ matrix.platform.unit-trials }}'
- uses: actions/upload-artifact@v4
name: Unit Tests Upload
if: ${{ failure() && steps.unit.conclusion == 'failure' }}
with:
name: unit-artifacts_${{ matrix.platform.os }}_${{ matrix.ghc.vers }}
path: test/unit/Unit/Data/Index/*actual
retention-days: 1
- name: Integration Tests
shell: bash
run: |
export INT_LOGS=1
cabal test integration ${{ matrix.ghc.proj_file }} --test-options '--hedgehog-tests ${{ matrix.platform.int-trials }} --hedgehog-discards 10000'
- name: Functional Tests
id: functional
run: cabal test functional ${{ matrix.ghc.proj_file }} --test-options '--size-cutoff 100000'
- uses: actions/upload-artifact@v4
name: Functional Tests Upload
if: ${{ failure() && steps.functional.conclusion == 'failure' }}
with:
name: functional-artifacts_${{ matrix.platform.os }}_${{ matrix.ghc.vers }}
path: test/functional/goldens/*actual
retention-days: 1
- name: Benchmarks
if: ${{ matrix.platform.os == 'ubuntu-latest' }}
id: bench
run: |
cabal bench ${{ matrix.ghc.proj_file }} --benchmark-options '
--csv benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc.vers }}_ci.csv
--svg benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc.vers }}_ci.svg
--baseline benchmarks/baseline_${{ matrix.platform.os }}_${{ matrix.ghc.vers }}_ci.csv
--fail-if-slower 50
--fail-if-faster 50'
- uses: actions/upload-artifact@v4
name: Benchmarks Upload
if: ${{ failure() && steps.bench.conclusion == 'failure' }}
with:
name: build-artifacts_${{ matrix.platform.os }}_${{ matrix.ghc.vers }}
path: |
benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc.vers }}_ci.csv
benchmarks/${{ matrix.platform.os }}_${{ matrix.ghc.vers }}_ci.svg
retention-days: 1
nix:
strategy:
fail-fast: false
matrix:
os:
- "macos-latest"
- "ubuntu-latest"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Compile & Test
run: nix build -Lv
lint:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Formatting
run: |
nix run .#format
git diff --exit-code --color=always
- name: Lint
run: |
nix run .#lint
release:
needs: [cabal, nix, lint]
if: github.ref == 'refs/heads/release'
strategy:
fail-fast: false
matrix:
platform:
- name: "macos-13"
os: "macos-13"
script: ".github/scripts/release_osx.sh"
script_args: ""
- name: "macos-14"
os: "macos-14"
script: ".github/scripts/release_osx.sh"
script_args: ""
- name: "macos-15"
os: "macos-15"
script: ".github/scripts/release_osx.sh"
script_args: ""
- name: "alpine_amd64"
os: "ubuntu-24.04"
script: ".github/scripts/release_linux.sh"
script_args: "alpine_amd64"
- name: "alpine_arm64v8"
os: "ubuntu-24.04-arm"
script: ".github/scripts/release_linux.sh"
script_args: "alpine_arm64v8"
- name: "windows-2025"
os: "windows-2025"
script: ".github/scripts/release_windows.sh"
script_args: "2025"
- name: "windows-2022"
os: "windows-2022"
script: ".github/scripts/release_windows.sh"
script_args: "2022"
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- name: Verify env vars
run: .github/scripts/verify_env.sh
- uses: docker/setup-docker-action@v4
if: ${{ matrix.platform.name == 'alpine_amd64' || matrix.platform.name == 'alpine_arm64v8' }}
# So we have sha256sum
- name: Install coreutils
if: ${{ matrix.platform.os == 'macos-13' || matrix.platform.os == 'macos-14' }}
run: brew install coreutils
- uses: haskell-actions/setup@v2
if: ${{ matrix.platform.name != 'alpine_amd64' && matrix.platform.name != 'alpine_arm64v8' }}
with:
ghc-version: ${{ env.GHC_VERS }}
cabal-version: ${{ env.CABAL_VERS }}
- name: Install binary
shell: bash
run: |
${{ matrix.platform.script }} ${{ matrix.platform.script_args }}
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: release-artifacts-${{ matrix.platform.name }}
path: charon*.zip
retention-days: 1
merge-releases:
runs-on: "ubuntu-latest"
needs: release
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: release-artifacts
pattern: release-artifacts-*
delete-merged: true
retention-days: 1