Skip to content

Commit 2c41fed

Browse files
authored
3583 upgrade to ghc 9.2.7 (#3584)
Fixes #3583 ### Scope: * Upgrades to lts-20.20 and ghc-9.2.7 * Removes all non-flake `nix` components * Removes the "performance" measurement (which was not very useful any more) * upgrades the Linux builds to ubuntu-22.04 * upgrades `hlint` to version `3.5` (minor adjustments required) * integrates the formatting pass into the `Test` workflow - for now it just prints a diff after formatting - later it should push a formatting commit and abort the workflow (exit with error) (next PR)
1 parent 0a3f245 commit 2c41fed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+462
-3623
lines changed

.github/workflows/release.yml

+14-50
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,13 @@ on:
55
- master
66

77
env:
8-
ghc_version: "9.2.5"
9-
stack_version: "2.9.1"
8+
ghc_version: "9.2.7"
9+
stack_version: "2.9.3"
1010

1111
jobs:
12-
13-
check:
14-
name: 'Check'
15-
runs-on: ubuntu-20.04
16-
steps:
17-
- name: Check out code
18-
uses: actions/checkout@v3
19-
with:
20-
submodules: recursive
21-
22-
- name: 'Install Nix'
23-
uses: cachix/install-nix-action@v19
24-
with:
25-
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
26-
extra_nix_config: |
27-
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
28-
substituters = http://cache.nixos.org https://hydra.iohk.io
29-
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
30-
31-
- name: Install Cachix
32-
uses: cachix/cachix-action@v12
33-
with:
34-
name: k-framework
35-
skipPush: true
36-
37-
- name: Materialize
38-
run: nix run .#update-cabal
39-
40-
- name: Check materialization
41-
run: |
42-
if [ -n "$(git status --porcelain 'nix/')" ]; then
43-
echo 2>&1 "Error: found modified files"
44-
git diff
45-
exit 1
46-
fi
47-
4812
release:
4913
name: 'Release'
50-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
5115
steps:
5216
- name: Check out code
5317
uses: actions/checkout@v3
@@ -70,11 +34,11 @@ jobs:
7034
authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'
7135

7236
- name: Build
73-
run: nix-build -A kore -A project.kore.checks
37+
run: nix-build -A project.x86_64_linux.kore -A project.x86_64_linux.kore.checks
7438

7539
cache-cabal:
7640
name: 'Cache Cabal'
77-
runs-on: ubuntu-20.04
41+
runs-on: ubuntu-22.04
7842
steps:
7943
- name: Install prerequisites
8044
run: |
@@ -108,7 +72,7 @@ jobs:
10872

10973
cache-stack:
11074
name: 'Cache Stack'
111-
runs-on: ubuntu-20.04
75+
runs-on: ubuntu-22.04
11276
steps:
11377
- name: Install prerequisites
11478
run: |
@@ -123,10 +87,10 @@ jobs:
12387
uses: actions/cache@v3
12488
with:
12589
path: ~/.stack
126-
key: stack-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
90+
key: stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
12791
restore-keys: |
128-
stack-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}
129-
stack-2-${{ runner.os }}-
92+
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}
93+
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}
13094
13195
- uses: haskell/actions/setup@v2
13296
id: setup-haskell-stack
@@ -142,7 +106,7 @@ jobs:
142106
143107
cache-stack-haddock:
144108
name: 'Cache Stack Haddock'
145-
runs-on: ubuntu-20.04
109+
runs-on: ubuntu-22.04
146110
steps:
147111
- name: Install prerequisites
148112
run: |
@@ -157,10 +121,10 @@ jobs:
157121
uses: actions/cache@v3
158122
with:
159123
path: ~/.stack
160-
key: stack-haddock-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
124+
key: stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
161125
restore-keys: |
162-
stack-haddock-2-${{ runner.os }}-${{ hashFiles('stack.yaml') }}
163-
stack-haddock-2-${{ runner.os }}
126+
stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}
127+
stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}
164128
165129
- uses: haskell/actions/setup@v2
166130
id: setup-haskell-stack
@@ -178,7 +142,7 @@ jobs:
178142
name: 'Publish Release'
179143
runs-on: ubuntu-latest
180144
environment: production
181-
needs: [check, release, cache-cabal, cache-stack, cache-stack-haddock]
145+
needs: [release, cache-cabal, cache-stack, cache-stack-haddock]
182146
steps:
183147
- name: 'Update dependents'
184148
env:

.github/workflows/test.yml

+96-73
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,85 @@ concurrency:
66
cancel-in-progress: true
77

88
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"
1111

1212
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+
1372
nix-build:
1473
name: 'Nix / Unit Tests'
74+
needs: formatting
1575
strategy:
1676
fail-fast: false
1777
matrix:
1878
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
2182
- runner: macos-12
2283
os: macos-12
84+
nix: x86_64-darwin
2385
- runner: MacM1
2486
os: self-macos-12
87+
nix: aarch64-darwin
2588
runs-on: ${{ matrix.runner }}
2689
steps:
2790
- name: Check out code
@@ -54,17 +117,17 @@ jobs:
54117
authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'
55118

56119
- name: Build
57-
run: nix-build -A kore
120+
run: GC_DONT_GC=1 nix-build -A project.${{ matrix.nix }}.kore.components.exes
58121

59122
- name: Check shell
60-
run: nix develop --print-build-logs --command stack --version
123+
run: nix develop --print-build-logs --command cabal --version
61124

62125
- 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
64127

65128
nix-integration:
66129
name: 'Nix / Integration'
67-
runs-on: ubuntu-20.04
130+
runs-on: ubuntu-22.04
68131
needs: nix-build
69132
steps:
70133
- name: Check out code
@@ -89,12 +152,21 @@ jobs:
89152
name: k-framework
90153
skipPush: true
91154

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"
92160
- 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"
94165
95166
cabal:
96167
name: 'Cabal / Unit Tests'
97-
runs-on: ubuntu-20.04
168+
needs: formatting
169+
runs-on: ubuntu-22.04
98170
steps:
99171
- name: Install prerequisites
100172
run: |
@@ -132,7 +204,8 @@ jobs:
132204

133205
stack:
134206
name: 'Stack / Unit Tests'
135-
runs-on: ubuntu-20.04
207+
needs: formatting
208+
runs-on: ubuntu-22.04
136209
steps:
137210
- name: Install prerequisites
138211
run: |
@@ -148,10 +221,10 @@ jobs:
148221
uses: actions/cache@v3
149222
with:
150223
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') }}
152225
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 }}
155228
156229
- uses: haskell/actions/setup@v2
157230
id: setup-haskell-stack
@@ -174,7 +247,8 @@ jobs:
174247

175248
stack-haddock:
176249
name: 'Stack / Haddock check'
177-
runs-on: ubuntu-20.04
250+
needs: formatting
251+
runs-on: ubuntu-22.04
178252
steps:
179253
- name: Install prerequisites
180254
run: |
@@ -190,10 +264,10 @@ jobs:
190264
uses: actions/cache@v3
191265
with:
192266
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') }}
194268
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 }}
197271
198272
- uses: haskell/actions/setup@v2
199273
id: setup-haskell-stack
@@ -208,9 +282,10 @@ jobs:
208282
stack haddock --fast
209283
hlint:
210284
name: 'HLint'
211-
runs-on: ubuntu-20.04
285+
needs: formatting
286+
runs-on: ubuntu-22.04
212287
env:
213-
hlint_version: "3.4.1"
288+
hlint_version: "3.5"
214289
steps:
215290
- uses: actions/checkout@v3
216291
with:
@@ -222,56 +297,4 @@ jobs:
222297
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
223298

224299
- 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

Comments
 (0)