Skip to content

Commit 54dda19

Browse files
authored
Update Stackage resolver to LTS Haskell 17.7 (#2505)
1 parent 3f2551a commit 54dda19

File tree

11 files changed

+171
-749
lines changed

11 files changed

+171
-749
lines changed

.github/workflows/test.yml

Lines changed: 75 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: "Test"
22
on:
33
pull_request:
44
jobs:
5-
nix:
6-
name: 'Nix'
5+
nix-build:
6+
name: 'Nix / Build'
77
strategy:
88
matrix:
99
os: [ubuntu-latest, macos-latest]
@@ -29,33 +29,74 @@ jobs:
2929
name: kore
3030
signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}'
3131

32-
- name: Check materialization
33-
run: |
34-
./nix/rematerialize.sh
35-
if [ ! $(git status --porcelain | wc -l) -eq 0 ]; then
36-
git diff
37-
exit 1
38-
fi
32+
- name: Build
33+
run: nix-build -A kore
3934

40-
- name: Commit changes
41-
uses: stefanzweifel/[email protected]
35+
nix-shell:
36+
name: 'Nix / Shell'
37+
strategy:
38+
matrix:
39+
os: [ubuntu-latest, macos-latest]
40+
runs-on: ${{ matrix.os }}
41+
steps:
42+
- name: Check out code
43+
uses: actions/[email protected]
4244
with:
43-
commit_message: 'Materialize Nix expressions'
44-
file_pattern: 'nix/'
45+
# Check out pull request HEAD instead of merge commit.
46+
ref: ${{ github.event.pull_request.head.sha }}
47+
submodules: recursive
4548

46-
- name: Build
47-
run: nix-build -A kore
49+
- name: Install Nix
50+
uses: cachix/install-nix-action@v12
51+
with:
52+
extra_nix_config: |
53+
substituters = http://cache.nixos.org https://hydra.iohk.io
54+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
4855
49-
- name: Run unit tests
50-
run: nix-build -A project.kore.checks
56+
- name: Install Cachix
57+
uses: cachix/cachix-action@v8
58+
with:
59+
name: kore
60+
signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}'
5161

5262
- name: Check shell
5363
run: nix-shell --run "echo OK"
5464

65+
nix-test:
66+
name: 'Nix / Test'
67+
needs: nix-build
68+
strategy:
69+
matrix:
70+
os: [ubuntu-latest, macos-latest]
71+
runs-on: ${{ matrix.os }}
72+
steps:
73+
- name: Check out code
74+
uses: actions/[email protected]
75+
with:
76+
# Check out pull request HEAD instead of merge commit.
77+
ref: ${{ github.event.pull_request.head.sha }}
78+
submodules: recursive
79+
80+
- name: Install Nix
81+
uses: cachix/install-nix-action@v12
82+
with:
83+
extra_nix_config: |
84+
substituters = http://cache.nixos.org https://hydra.iohk.io
85+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
86+
87+
- name: Install Cachix
88+
uses: cachix/cachix-action@v8
89+
with:
90+
name: kore
91+
signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}'
92+
93+
- name: Run unit tests
94+
run: nix-build -A project.kore.checks
95+
5596
nix-integration:
5697
name: 'Nix / Integration'
5798
runs-on: ubuntu-latest
58-
needs: nix
99+
needs: nix-build
59100
steps:
60101
- name: Check out code
61102
uses: actions/[email protected]
@@ -97,18 +138,20 @@ jobs:
97138
ref: ${{ github.event.pull_request.head.sha }}
98139
submodules: recursive
99140

141+
- name: Cache Cabal package database and store
142+
uses: actions/cache@v2
143+
with:
144+
path: |
145+
~/.cabal/packages
146+
~/.cabal/store
147+
key: cabal-1-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('cabal.project') }}
148+
100149
- uses: haskell/actions/setup@v1
101150
id: setup-haskell-cabal
102151
with:
103152
ghc-version: ${{ env.ghc_version }}
104153
cabal-version: "3.2"
105154

106-
- name: Cache Cabal store
107-
uses: actions/cache@v2
108-
with:
109-
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
110-
key: ${{ runner.os }}-ghc-${{ env.ghc_version }}
111-
112155
- name: Build
113156
run: cabal v2-build --enable-tests --enable-benchmarks all
114157

@@ -132,28 +175,23 @@ jobs:
132175
ref: ${{ github.event.pull_request.head.sha }}
133176
submodules: recursive
134177

178+
- name: Cache Stack root
179+
uses: actions/cache@v2
180+
with:
181+
path: ~/.stack
182+
key: stack-1-${{ runner.os }}-${{ hashFiles('stack.yaml.lock') }}
183+
135184
- uses: haskell/actions/setup@v1
136185
id: setup-haskell-stack
137186
with:
138187
enable-stack: true
139188
stack-no-global: true
140189
stack-setup-ghc: true
141190

142-
- name: Locate Stack root
143-
id: locate-stack-root
144-
run: |
145-
echo "::set-output name=stack-root::$(stack path --stack-root)"
146-
147-
- name: Cache Stack root
148-
uses: actions/cache@v2
149-
with:
150-
path: ${{ steps.locate-stack-root.outputs.stack-root }}
151-
key: ${{ runner.os }}-${{ hashFiles('stack.yaml.lock') }}
152-
153191
- name: Build dependencies
154192
run: |
155-
stack build --only-dependencies
156-
if [ ! $(git status --porcelain | wc -l) -eq 0 ]; then
193+
stack build --test --only-dependencies
194+
if [ -n "$(git status --porcelain)" ]; then
157195
git diff
158196
exit 1
159197
fi
@@ -176,37 +214,3 @@ jobs:
176214

177215
- name: Run hlint
178216
run: curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s kore -j
179-
180-
fourmolu:
181-
name: 'Style'
182-
runs-on: ubuntu-latest
183-
steps:
184-
- name: Check out code
185-
uses: actions/[email protected]
186-
with:
187-
submodules: recursive
188-
189-
- name: Install Nix
190-
uses: cachix/install-nix-action@v12
191-
with:
192-
extra_nix_config: |
193-
substituters = http://cache.nixos.org https://hydra.iohk.io
194-
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
195-
196-
- name: Install Cachix
197-
uses: cachix/cachix-action@v8
198-
with:
199-
name: kore
200-
signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}'
201-
skipPush: true
202-
203-
- name: Format
204-
run: |
205-
./nix/fourmolu.sh
206-
207-
- name: Check for changes
208-
run: |
209-
if [ ! $(git status --porcelain | wc -l) -eq 0 ]; then
210-
git diff
211-
exit 1
212-
fi

.github/workflows/update.yml

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,28 @@ on:
33
push:
44
branches-ignore:
55
- 'master'
6+
pull_request:
67
jobs:
78
nix:
89
name: 'Nix'
910
runs-on: ubuntu-latest
1011
steps:
12+
- id: config
13+
run: |
14+
if [ "${{ github.event_name }}" == 'pull_request' ]
15+
then
16+
echo "::set-output name=ref::${{ github.event.pull_request.head.sha }}"
17+
else
18+
echo "::set-output name=ref::$GITHUB_SHA"
19+
fi
20+
21+
git config --global user.name github-actions
22+
git config --global user.email [email protected]
23+
1124
- name: Check out code
1225
uses: actions/[email protected]
1326
with:
27+
ref: ${{ steps.config.outputs.ref }}
1428
submodules: recursive
1529

1630
- name: Install Nix
@@ -25,25 +39,48 @@ jobs:
2539
with:
2640
name: kore
2741
signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}'
28-
skipPush: true
2942

3043
- name: Materialize
31-
run: |
32-
./nix/rematerialize.sh
44+
run: ./nix/rematerialize.sh
3345

34-
- name: Commit changes
35-
uses: stefanzweifel/[email protected]
36-
with:
37-
commit_message: 'Materialize Nix expressions'
38-
file_pattern: 'nix/ *.cabal'
46+
- name: Update branch
47+
env:
48+
GITHUB_EVENT_NAME: ${{ github.event_name }}
49+
run: |
50+
if [ -n "$(git status --porcelain 'nix/')" ]; then
51+
if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then
52+
echo 2>&1 "Error: found modified files"
53+
git diff
54+
exit 1
55+
elif [[ $GITHUB_EVENT_NAME == 'push' ]]; then
56+
git add 'nix/'
57+
git commit -m 'Materialize Nix expressions'
58+
git push
59+
else
60+
echo 2>&1 "Error: event not supported: $GITHUB_EVENT_NAME"
61+
fi
62+
fi
3963
4064
fourmolu:
4165
name: 'Style'
4266
runs-on: ubuntu-latest
4367
steps:
68+
- id: config
69+
run: |
70+
if [ "${{ github.event_name }}" == 'pull_request' ]
71+
then
72+
echo "::set-output name=ref::${{ github.event.pull_request.head.sha }}"
73+
else
74+
echo "::set-output name=ref::$GITHUB_SHA"
75+
fi
76+
77+
git config --global user.name github-actions
78+
git config --global user.email [email protected]
79+
4480
- name: Check out code
4581
uses: actions/[email protected]
4682
with:
83+
ref: ${{ steps.config.outputs.ref }}
4784
submodules: recursive
4885

4986
- name: Install Nix
@@ -58,15 +95,24 @@ jobs:
5895
with:
5996
name: kore
6097
signingKey: '${{ secrets.KORE_CACHIX_SIGNING_KEY }}'
61-
skipPush: true
6298

6399
- name: Format
64-
run: |
65-
./nix/fourmolu.sh
66-
67-
- name: Commit changes
68-
uses: stefanzweifel/[email protected]
69-
with:
70-
commit_message: 'Format with fourmolu'
71-
file_pattern: '*.hs'
100+
run: ./nix/fourmolu.sh
72101

102+
- name: Update branch
103+
env:
104+
GITHUB_EVENT_NAME: ${{ github.event_name }}
105+
run: |
106+
if [ -n "$(git status --porcelain '*.hs')" ]; then
107+
if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then
108+
echo 2>&1 "Error: found modified files"
109+
git diff
110+
exit 1
111+
elif [[ $GITHUB_EVENT_NAME == 'push' ]]; then
112+
git add '*.hs'
113+
git commit -m 'Format with fourmolu'
114+
git push
115+
else
116+
echo 2>&1 "Error: event not supported: $GITHUB_EVENT_NAME"
117+
fi
118+
fi

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ allow-newer:
55
ghc-trace-events:base
66

77
package *
8-
ghc-options: -fhide-source-paths
8+
ghc-options: -fhide-source-paths -haddock
99
profiling-detail: none
1010

1111
package kore

default.nix

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919

2020
let
2121
sources = import ./nix/sources.nix;
22-
23-
pkgs =
24-
let
25-
haskell-nix = import sources."haskell.nix" {};
26-
inherit (haskell-nix) nixpkgsArgs;
27-
args = nixpkgsArgs // { };
28-
in import haskell-nix.sources.nixpkgs-2003 args;
22+
haskell-nix = import sources."haskell.nix" {};
23+
inherit (haskell-nix) pkgs;
2924
inherit (pkgs) lib;
3025

3126
ttuegel =

nix/hlint.nix.d/.plan.nix/engine.nix

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)