Skip to content

Commit 923bc3d

Browse files
Github Actions update from bellroy/gha-workflows#743 (#2)
* workflow update from gha-workflows * Remove support for 8.10 * Restore 8.10 and try to get past the text hurdle * Try text 1.2.4 * Provide another option for containers * GHC 8.10 is officially too-hard-basket * GHC 9.0 is officially too-hard-basket * Only support 9.6 onwards * Specific text versions * Try different containers versions * Add another text version * Add another bytestring version * Add another bytestring version * Add another containers version * Add another containers version * hoist-error does not support >9.8 * Add golden tests files to extra-source-files * Add comment about hoist-error --------- Co-authored-by: michaelwebb76 <[email protected]> Co-authored-by: Michael Webb <[email protected]>
1 parent 2ed1b08 commit 923bc3d

File tree

3 files changed

+76
-73
lines changed

3 files changed

+76
-73
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 62 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
1+
# This file is generated by `generate.sh`.
2+
# Generated from https://github.com/bellroy/gha-workflows/tree/master/dhall/workflows/github-actions/haskell-ci.dhall
3+
# Think twice before editing it directly.
14
jobs:
25
generate-matrix:
3-
name: "Generate matrix from cabal"
6+
name: Generate matrix from cabal
47
outputs:
5-
matrix: ${{ steps.set-matrix.outputs.matrix }}
8+
matrix: "${{ steps.set-matrix.outputs.matrix }}"
69
runs-on: ubuntu-24.04
710
steps:
8-
- name: Extract the tested GHC versions
9-
id: set-matrix
10-
uses: kleidukos/get-tested@a0aa3f2d4ab0d10daa49dc9ee8c706d673fb0e02
11+
- id: set-matrix
12+
name: Extract the tested GHC versions
13+
uses: "kleidukos/get-tested@a0aa3f2d4ab0d10daa49dc9ee8c706d673fb0e02"
1114
with:
1215
cabal-file: github-actions.cabal
13-
ubuntu-version: "24.04"
14-
version: 0.1.7.1
16+
ubuntu-version: '24.04'
17+
version: '0.1.7.1'
18+
timeout-minutes: 30
1519
tests:
16-
name: ${{ matrix.ghc }} on ${{ matrix.os }}
17-
needs: generate-matrix
18-
runs-on: ${{ matrix.os }}
1920
container:
2021
image: buildpack-deps:jammy
21-
strategy:
22-
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
22+
name: "${{ matrix.ghc }} on ${{ matrix.os }}"
23+
needs:
24+
- generate-matrix
25+
runs-on: "${{ matrix.os }}"
2326
steps:
24-
- name: apt
27+
- env:
28+
HCKIND: ghc
29+
HCNAME: "ghc-${{ matrix.ghc }}"
30+
HCVER: "${{ matrix.ghc }}"
31+
name: apt
2532
run: |
2633
apt-get update
2734
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
@@ -30,11 +37,11 @@ jobs:
3037
chmod a+x "$HOME/.ghcup/bin/ghcup"
3138
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
3239
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
33-
env:
40+
- env:
3441
HCKIND: ghc
35-
HCNAME: ghc-${{ matrix.ghc }}
36-
HCVER: ${{ matrix.ghc }}
37-
- name: Set PATH and environment variables
42+
HCNAME: "ghc-${{ matrix.ghc }}"
43+
HCVER: "${{ matrix.ghc }}"
44+
name: Set PATH and environment variables
3845
run: |
3946
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
4047
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
@@ -55,13 +62,8 @@ jobs:
5562
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
5663
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
5764
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
58-
env:
59-
HCKIND: ghc
60-
HCNAME: ghc-${{ matrix.ghc }}
61-
HCVER: ${{ matrix.ghc }}
6265
- name: env
63-
run: |
64-
env
66+
run: env
6567
- name: write cabal config
6668
run: |
6769
mkdir -p $CABAL_DIR
@@ -92,13 +94,12 @@ jobs:
9294
$HC --print-project-git-commit-id || true
9395
$CABAL --version || true
9496
- name: update cabal index
95-
run: |
96-
$CABAL v2-update -v
97-
- name: cache (tools)
98-
uses: actions/cache/restore@v4
97+
run: "$CABAL v2-update -v"
98+
- name: "cache (tools)"
99+
uses: "actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684"
99100
with:
100-
key: ${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1
101-
path: ~/.haskell-ci-tools
101+
key: "${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1"
102+
path: "~/.haskell-ci-tools"
102103
- name: install cabal-plan
103104
run: |
104105
mkdir -p $HOME/.cabal/bin
@@ -112,14 +113,14 @@ jobs:
112113
run: |
113114
$CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.24.0'
114115
doctest --version
115-
- name: save cache (tools)
116-
uses: actions/cache/save@v4
117-
if: always()
116+
- if: "always()"
117+
name: "save cache (tools)"
118+
uses: "actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684"
118119
with:
119-
key: ${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1
120-
path: ~/.haskell-ci-tools
120+
key: "${{ runner.os }}-${{ matrix.ghc }}-tools-ac1dc7e1"
121+
path: "~/.haskell-ci-tools"
121122
- name: checkout
122-
uses: actions/checkout@v4
123+
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11"
123124
with:
124125
path: source
125126
- name: initial cabal.project for sdist
@@ -137,29 +138,29 @@ jobs:
137138
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
138139
- name: generate cabal.project
139140
run: |
140-
PKGDIR_aws_arn="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/aws-arn-[0-9.]*')"
141-
echo "PKGDIR_aws_arn=${PKGDIR_aws_arn}" >> "$GITHUB_ENV"
141+
PKGDIR_PROJECT="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/github-actions-[0-9.]*')"
142+
echo "PKGDIR_PROJECT=${PKGDIR_PROJECT}" >> "$GITHUB_ENV"
142143
rm -f cabal.project cabal.project.local
143144
touch cabal.project
144145
touch cabal.project.local
145-
echo "packages: ${PKGDIR_aws_arn}" >> cabal.project
146-
echo "package aws-arn" >> cabal.project
146+
echo "packages: ${PKGDIR_PROJECT}" >> cabal.project
147+
echo "package github-actions" >> cabal.project
147148
echo " ghc-options: -Werror=missing-methods" >> cabal.project
148149
cat >> cabal.project <<EOF
149150
EOF
150-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(aws-arn)$/; }' >> cabal.project.local
151+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(github-actions)$/; }' >> cabal.project.local
151152
cat cabal.project
152153
cat cabal.project.local
153154
- name: dump install plan
154155
run: |
155156
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
156157
cabal-plan
157158
- name: restore cache
158-
uses: actions/cache/restore@v4
159+
uses: "actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684"
159160
with:
160-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
161-
path: ~/.cabal/store
162-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
161+
key: "${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}"
162+
path: "~/.cabal/store"
163+
restore-keys: "${{ runner.os }}-${{ matrix.ghc }}-"
163164
- name: install dependencies
164165
run: |
165166
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
@@ -175,11 +176,11 @@ jobs:
175176
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
176177
- name: doctest
177178
run: |
178-
cd ${PKGDIR_aws_arn} || false
179-
doctest -XHaskell2010 src
179+
cd ${PKGDIR_PROJECT} || false
180+
doctest -XHaskell2010 src
180181
- name: cabal check
181182
run: |
182-
cd ${PKGDIR_aws_arn} || false
183+
cd ${PKGDIR_PROJECT} || false
183184
${CABAL} -vnormal check
184185
- name: haddock
185186
run: |
@@ -188,12 +189,20 @@ jobs:
188189
run: |
189190
rm -f cabal.project.local
190191
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
191-
- name: save cache
192-
uses: actions/cache/save@v4
193-
if: always()
192+
- if: "always()"
193+
name: save cache
194+
uses: "actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684"
194195
with:
195-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
196-
path: ~/.cabal/store
196+
key: "${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}"
197+
path: "~/.cabal/store"
198+
strategy:
199+
matrix:
200+
include:
201+
- "${{ (fromJSON(needs.generate-matrix.outputs.matrix)).include }}"
202+
timeout-minutes: 30
197203
name: Haskell CI
198204
on:
199-
- push
205+
push:
206+
branches-ignore:
207+
- "refs/tags/*_staging"
208+
- "refs/tags/*_production"

flake.nix

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
bellroy-nix-foss.url = "github:bellroy/bellroy-nix-foss";
44
};
55

6-
outputs = inputs:
6+
outputs =
7+
inputs:
78
inputs.bellroy-nix-foss.lib.haskellProject {
89
src = ./.;
910
supportedCompilers = [
10-
"ghc810"
11-
"ghc90"
12-
"ghc92"
13-
"ghc94"
1411
"ghc96"
1512
"ghc98"
16-
"ghc910"
17-
"ghc912"
1813
];
1914
defaultCompiler = "ghc96";
2015
};

github-actions.cabal

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ maintainer: Bellroy Tech Team <[email protected]>
1515
copyright: Copyright (C) 2025 Bellroy Pty Ltd
1616
category: Language
1717
build-type: Simple
18-
extra-source-files: README.md
19-
tested-with:
20-
GHC ==8.10.7
21-
|| ==9.0.2
22-
|| ==9.2.4
23-
|| ==9.4.5
24-
|| ==9.6.6
25-
|| ==9.8.2
26-
|| ==9.10.1
27-
|| ==9.12.1
18+
extra-source-files:
19+
README.md
20+
test/golden/configuration-main.golden.yml
21+
test/golden/configuration-main.hs.txt
22+
test/golden/configuration-main.yml
23+
24+
-- `hoist-error` is currently blocking GHC >9.8
25+
-- https://github.com/qfpl/hs-hoist-error/pull/12
26+
tested-with: GHC ==9.6.6 || ==9.8.2
2827

2928
common opts
3029
default-language: Haskell2010
@@ -39,11 +38,11 @@ common deps
3938
build-depends:
4039
, aeson ^>=2.2.3.0
4140
, base >=4.14 && <4.22
42-
, containers ^>=0.6.8
41+
, containers ==0.6.7 || ==0.6.8 || ==0.7 || ==0.8
4342
, hedgehog ^>=1.5
4443
, hoist-error ^>=0.3.0.0
4544
, string-interpolate ^>=0.3.3
46-
, text ^>=2.1
45+
, text ==1.2.4.1 || ==2.0.2 || ==2.1.1
4746
, vector ^>=0.13.0.0
4847

4948
library
@@ -79,7 +78,7 @@ test-suite github-actions-tests
7978
other-modules: Language.Github.Actions.WorkflowTest
8079
build-tool-depends: tasty-discover:tasty-discover ^>=4.2.2
8180
build-depends:
82-
, bytestring ^>=0.11
81+
, bytestring ==0.11.5.3 || ==0.12.1.0
8382
, filepath ^>=1.4.2.2
8483
, github-actions
8584
, pretty-show ^>=1.10

0 commit comments

Comments
 (0)