@@ -6,22 +6,85 @@ concurrency:
6
6
cancel-in-progress : true
7
7
8
8
env :
9
- ghc_version : " 9.2.5 "
10
- stack_version : " 2.9.1 "
9
+ ghc_version : " 9.2.7 "
10
+ stack_version : " 2.9.3 "
11
11
12
12
jobs :
13
+ formatting :
14
+ name : ' Auto-formatting'
15
+ runs-on : ubuntu-22.04
16
+ steps :
17
+ - id : config
18
+ run : |
19
+ ref="${{ github.event.pull_request.head.sha }}"
20
+ ref="${ref#refs/heads/}"
21
+ echo "ref=$ref" >> $GITHUB_OUTPUT
22
+
23
+ git config --global user.name github-actions
24
+ git config --global user.email [email protected]
25
+
26
+ - name : Check out code
27
+ uses : actions/checkout@v3
28
+ with :
29
+ ref : ${{ steps.config.outputs.ref }}
30
+ submodules : recursive
31
+ token : ${{ secrets.JENKINS_GITHUB_PAT }}
32
+
33
+ - name : ' Install Nix'
34
+ uses : cachix/install-nix-action@v19
35
+ with :
36
+ install_url : https://releases.nixos.org/nix/nix-2.13.3/install
37
+ extra_nix_config : |
38
+ access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
39
+ substituters = http://cache.nixos.org https://cache.iog.io
40
+ trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
41
+
42
+ - name : ' Install Cachix'
43
+ uses : cachix/cachix-action@v12
44
+ with :
45
+ name : k-framework
46
+ authToken : ' ${{ secrets.CACHIX_PUBLIC_TOKEN }}'
47
+
48
+ - name : Format
49
+ run : |
50
+ nix run .#format
51
+
52
+ - name : Update branch
53
+ env :
54
+ GITHUB_EVENT_NAME : ${{ github.event_name }}
55
+ run : |
56
+ if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
57
+ if git status -s -b | grep -q '^##.*(no branch)$'; then
58
+ echo 2>&1 "Error: Git is in detached HEAD state"
59
+ exit 1
60
+ fi
61
+ fi
62
+
63
+ if [ -n "$(git status --porcelain '*.hs')" ]; then
64
+ git add '*.hs'
65
+ git commit -m "Format with fourmolu"
66
+ git show --stat
67
+ # git push
68
+ echo "Reformatted code pushed, aborting this workflow" | tee -a $GITHUB_STEP_SUMMARY
69
+ # exit 1
70
+ fi
71
+
13
72
nix-build :
14
73
name : ' Nix / Unit Tests'
74
+ needs : formatting
15
75
strategy :
16
76
fail-fast : false
17
77
matrix :
18
78
include :
19
- - runner : ubuntu-20.04
20
- os : ubuntu-20.04
79
+ - runner : ubuntu-22.04
80
+ os : ubuntu-22.04
81
+ nix : x86_64-linux
21
82
- runner : macos-12
22
83
os : macos-12
84
+ nix : x86_64-darwin
23
85
- runner : MacM1
24
86
os : self-macos-12
87
+ nix : aarch64-darwin
25
88
runs-on : ${{ matrix.runner }}
26
89
steps :
27
90
- name : Check out code
@@ -54,17 +117,17 @@ jobs:
54
117
authToken : ' ${{ secrets.CACHIX_PUBLIC_TOKEN }}'
55
118
56
119
- name : Build
57
- run : nix-build -A kore
120
+ run : GC_DONT_GC=1 nix-build -A project.${{ matrix.nix }}. kore.components.exes
58
121
59
122
- name : Check shell
60
- run : nix develop --print-build-logs --command stack --version
123
+ run : nix develop --print-build-logs --command cabal --version
61
124
62
125
- name : Run unit tests
63
- run : nix-build -A project.kore.checks
126
+ run : GC_DONT_GC=1 nix-build -A project.${{ matrix.nix }} .kore.checks
64
127
65
128
nix-integration :
66
129
name : ' Nix / Integration'
67
- runs-on : ubuntu-20 .04
130
+ runs-on : ubuntu-22 .04
68
131
needs : nix-build
69
132
steps :
70
133
- name : Check out code
@@ -89,12 +152,21 @@ jobs:
89
152
name : k-framework
90
153
skipPush : true
91
154
155
+ - name : Test paths to Haskell backend binaries
156
+ run : |
157
+ nix develop github:runtimeverification/k/sam/nix-kore-integration-shell#kore-integration-tests \
158
+ --override-input haskell-backend . --update-input haskell-backend \
159
+ --command bash -c "echo kore-exec; which kore-exec; kore-exec --version; echo kore-parser; which kore-parser; kore-parser --version; echo kore-repl; which kore-repl; kore-repl --version; echo kore-match-disjunction; which kore-match-disjunction; kore-match-disjunction --version"
92
160
- name : Run integration tests
93
- run : nix-build test.nix
161
+ run : |
162
+ nix develop github:runtimeverification/k/sam/nix-kore-integration-shell#kore-integration-tests \
163
+ --override-input haskell-backend . --update-input haskell-backend \
164
+ --command bash -c "cd test && make -j2 --output-sync test"
94
165
95
166
cabal :
96
167
name : ' Cabal / Unit Tests'
97
- runs-on : ubuntu-20.04
168
+ needs : formatting
169
+ runs-on : ubuntu-22.04
98
170
steps :
99
171
- name : Install prerequisites
100
172
run : |
@@ -132,7 +204,8 @@ jobs:
132
204
133
205
stack :
134
206
name : ' Stack / Unit Tests'
135
- runs-on : ubuntu-20.04
207
+ needs : formatting
208
+ runs-on : ubuntu-22.04
136
209
steps :
137
210
- name : Install prerequisites
138
211
run : |
@@ -148,10 +221,10 @@ jobs:
148
221
uses : actions/cache@v3
149
222
with :
150
223
path : ~/.stack
151
- key : stack-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
224
+ key : stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}- ${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
152
225
restore-keys : |
153
- stack-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}
154
- stack-2-${{ runner.os }}-
226
+ stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}- ${{ hashFiles('stack.yaml') }}
227
+ stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}
155
228
156
229
- uses : haskell/actions/setup@v2
157
230
id : setup-haskell-stack
@@ -174,7 +247,8 @@ jobs:
174
247
175
248
stack-haddock :
176
249
name : ' Stack / Haddock check'
177
- runs-on : ubuntu-20.04
250
+ needs : formatting
251
+ runs-on : ubuntu-22.04
178
252
steps :
179
253
- name : Install prerequisites
180
254
run : |
@@ -190,10 +264,10 @@ jobs:
190
264
uses : actions/cache@v3
191
265
with :
192
266
path : ~/.stack
193
- key : stack-haddock-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
267
+ key : stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}- ${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
194
268
restore-keys : |
195
- stack-haddock-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}
196
- stack-haddock-2-${{ runner.os }}
269
+ stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}- ${{ hashFiles('stack.yaml') }}
270
+ stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}
197
271
198
272
- uses : haskell/actions/setup@v2
199
273
id : setup-haskell-stack
@@ -208,9 +282,10 @@ jobs:
208
282
stack haddock --fast
209
283
hlint :
210
284
name : ' HLint'
211
- runs-on : ubuntu-20.04
285
+ needs : formatting
286
+ runs-on : ubuntu-22.04
212
287
env :
213
- hlint_version : " 3.4.1 "
288
+ hlint_version : " 3.5 "
214
289
steps :
215
290
- uses : actions/checkout@v3
216
291
with :
@@ -222,56 +297,4 @@ jobs:
222
297
run : curl -sSL https://github.com/ndmitchell/hlint/releases/download/v${{ env.hlint_version }}/hlint-${{ env.hlint_version }}-x86_64-linux.tar.gz | tar xvz
223
298
224
299
- name : Run hlint
225
- run : hlint-${{ env.hlint_version }}/hlint kore -j
226
-
227
- performance :
228
- needs : [nix-build]
229
- name : ' Performance'
230
- runs-on : ubuntu-20.04
231
- steps :
232
- - name : Check out code
233
- uses : actions/checkout@v3
234
- with :
235
- # Check out pull request HEAD instead of merge commit.
236
- ref : ${{ github.event.pull_request.head.sha }}
237
- submodules : recursive
238
-
239
- - name : Install Nix
240
- uses : cachix/install-nix-action@v19
241
- with :
242
- install_url : https://releases.nixos.org/nix/nix-2.13.3/install
243
- extra_nix_config : |
244
- access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
245
- substituters = http://cache.nixos.org https://hydra.iohk.io
246
- trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
247
-
248
- - name : Install Cachix
249
- uses : cachix/cachix-action@v12
250
- with :
251
- name : k-framework
252
- authToken : ' ${{ secrets.CACHIX_PUBLIC_TOKEN }}'
253
- skipPush : true
254
-
255
- - name : Collect performance statistics
256
- env :
257
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
258
- run : |
259
- ./scripts/test-statistics.sh ./. \
260
- test/regression-evm \
261
- test/regression-wasm \
262
- > pull-request.json
263
- git fetch origin
264
- git worktree add kore-master master
265
- ./scripts/test-statistics.sh ./kore-master \
266
- test/regression-evm \
267
- test/regression-wasm \
268
- > master.json
269
- ./scripts/join-statistics.sh master.json pull-request.json \
270
- | ./scripts/format-statistics.sh \
271
- > comment.md
272
- if [[ $(sed -E -e '1,2d ; /.*\| (0|-?0.0[0-4][0-9]*) \| (0|-?0.0[0-4][0-9]*) \|$/d' comment.md | wc -l) -ne 0 ]]; then\
273
- gh pr comment ${{ github.event.pull_request.number }} -F comment.md; \
274
- else \
275
- echo "Produced statistics are boring, just printing them right here:"; \
276
- cat comment.md; \
277
- fi
300
+ run : hlint-${{ env.hlint_version }}/hlint kore kore-rpc-types -j
0 commit comments