4
4
push :
5
5
paths-ignore :
6
6
- ' docs/*/**'
7
+ branches : [master]
7
8
pull_request :
8
9
9
10
jobs :
40
41
with :
41
42
ghc-version : ${{ matrix.ghc-version }}
42
43
cabal-version : ' 3.12.1.0'
43
-
44
+
44
45
- name : Generate freeze file
45
46
run : |
46
47
cabal update
@@ -51,23 +52,55 @@ jobs:
51
52
# avoid invalidating cache too often.
52
53
# This idea comes from github.com/jaspervdj/hakyll
53
54
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
54
-
55
+
55
56
- name : Cache cabal work
56
57
uses : actions/cache@v4
57
58
with :
58
59
path : |
59
60
dist-newstyle
60
61
${{ steps.setup-haskell.outputs.cabal-store }}
61
62
key : ${{ runner.os }}-${{ hashFiles('dependencies-versions', 'cabal.project.local') }}-cabal-install
62
-
63
+
63
64
- name : Build dependencies
64
65
run : |
65
66
cabal build all --only-dependencies ${{matrix.cabal-flags}}
66
-
67
+
67
68
- name : Build beam packages
68
69
run : |
69
70
cabal build all ${{matrix.cabal-flags}}
70
-
71
+
71
72
- name : Run tests
72
73
run : |
73
- cabal test all ${{matrix.cabal-flags}}
74
+ cabal test all ${{matrix.cabal-flags}}
75
+
76
+ release-artifacts :
77
+ # Only build release artifacts if `continuous-integration` is successful
78
+ needs : [continuous-integration]
79
+ runs-on : ubuntu-24.04
80
+
81
+ steps :
82
+ - uses : actions/checkout@v4
83
+
84
+ - name : Check packages for common mistakes
85
+ run : |
86
+ for pkg in $(find . -mindepth 1 -maxdepth 1 -type d -name "beam-*")
87
+ do
88
+ cd $pkg
89
+ echo "Checking $pkg"
90
+ cabal check
91
+ cd $GITHUB_WORKSPACE
92
+ done
93
+
94
+ # Note that the ubuntu-24.04 image includes cabal
95
+ # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#haskell-tools
96
+ - name : Build release artifacts
97
+ run : |
98
+ cabal sdist all
99
+
100
+ - name : Upload build artifacts
101
+ uses : actions/upload-artifact@v4
102
+ if : github.ref == 'refs/heads/master'
103
+ with :
104
+ name : ${{ runner.os }}-release-artifact
105
+ path : dist-newstyle/sdist/beam-*
106
+ retention-days : 7
0 commit comments