@@ -57,20 +57,23 @@ jobs:
57
57
with :
58
58
ghc-version : ${{ matrix.ghc }}
59
59
cabal-version : ' latest'
60
+
60
61
- name : Configure
61
62
run : |
62
63
ARCHITECTURE=$(uname -m)
63
64
echo "ARCH=$ARCHITECTURE" >> $GITHUB_ENV
64
65
echo ${{ env.ARCH }}
65
66
cabal configure --enable-tests
67
+
66
68
- name : Freeze
67
69
run : cabal freeze --project-file=cabal.release.project
70
+
68
71
- name : Cache
69
72
uses : actions/cache@v4.0.2
70
73
with :
71
74
path : ${{ steps.setup-haskell.outputs.cabal-store }}
72
- key : ${{ runner .os }}-ghc-${{ matrix.ghc }}-${{ hashFiles('**/plan.json') }}
73
- restore-keys : ${{ runner .os }}-ghc-${{ matrix.ghc }}-
75
+ key : ${{ matrix .os }}-ghc-${{ matrix.ghc }}-${{ hashFiles('**/plan.json') }}
76
+ restore-keys : ${{ matrix .os }}-ghc-${{ matrix.ghc }}-
74
77
75
78
- name : Build
76
79
run : cabal build --project-file=cabal.release.project
83
86
cp "${path}" distribution
84
87
done
85
88
echo "$GITHUB_WORKSPACE/distribution" >> "$GITHUB_PATH"
89
+ echo "REPORT_NAME=report-${{ matrix.os }}-ghc-${{ matrix.ghc }}" >> $GITHUB_ENV
90
+
91
+ - name : Test
92
+ run : cabal test --project-file=cabal.release.project --test-options "--xml=../print-api/${{ env.REPORT_NAME }}.xml" all
93
+
94
+ - name : Upload the test report
95
+ uses : actions/upload-artifact@v4
96
+ if : success() || failure() # always run even if the previous step fails
97
+ with :
98
+ name : ${{ env.REPORT_NAME }}
99
+ path : ${{ env.REPORT_NAME }}.xml
86
100
87
101
- name : File type
88
102
run : file distribution/*
@@ -100,14 +114,15 @@ jobs:
100
114
run : |
101
115
executables=( $(ls distribution) )
102
116
version=$(./distribution/print-api --version)
103
- archive="print-api-${version}-${{ runner .os }}-${{ env.ARCH }}-ghc-${{ matrix.ghc }}.tar.gz"
117
+ archive="print-api-${version}-${{ matrix .os }}-${{ env.ARCH }}-ghc-${{ matrix.ghc }}.tar.gz"
104
118
tar -czvf "${archive}" -C distribution "${executables[@]}"
105
119
echo "PRINTAPI_EXEC_TAR=${archive}" >> $GITHUB_ENV
120
+ echo "ARTIFACT_NAME=artifact-${{ matrix.os }}-ghc-${{ matrix.ghc }}" >> $GITHUB_ENV
106
121
107
122
- name : Upload the executables archive
108
- uses : actions/upload-artifact@v3
123
+ uses : actions/upload-artifact@v4
109
124
with :
110
- name : artifact
125
+ name : ${{ env.ARTIFACT_NAME }}
111
126
path : ${{ env.PRINTAPI_EXEC_TAR }}
112
127
113
128
build-alpine :
@@ -145,11 +160,12 @@ jobs:
145
160
- name : Freeze
146
161
run : cabal freeze --project-file=cabal.static.project
147
162
148
- - uses : actions/cache@v4
163
+ - name : Cache
164
+ uses : actions/cache@v4
149
165
with :
150
166
path : ${{ steps.setup-haskell.outputs.cabal-store }}
151
- key : ${{ runner.os }} -ghc-${{ steps.setup.outputs. ghc-version }}-${{ hashFiles('**/plan.json') }}
152
- restore-keys : ${{ runner.os }} -${{ steps.setup.outputs. ghc-version }}-
167
+ key : alpine -ghc-${{ matrix. ghc }}-${{ hashFiles('**/plan.json') }}
168
+ restore-keys : alpine-3.20 -${{ matrix. ghc }}-
153
169
154
170
- name : Build
155
171
run : cabal build --project-file=cabal.static.project
@@ -162,15 +178,17 @@ jobs:
162
178
cp "${path}" distribution
163
179
done
164
180
echo "$GITHUB_WORKSPACE/distribution" >> "$GITHUB_PATH"
181
+ echo "REPORT_NAME=report-alpine-3.20-ghc-${{ matrix.ghc }}" >> $GITHUB_ENV
165
182
166
183
- name : Test
167
- run : cabal test --project-file=cabal.static.project --test-options "--xml=../print-api/report .xml" all
184
+ run : cabal test --project-file=cabal.static.project --test-options "--xml=../print-api/${REPORT_NAME} .xml" all
168
185
169
- - name : Publish Test Report
170
- uses : mikepenz/action-junit-report @v4
186
+ - name : Upload the test report
187
+ uses : actions/upload-artifact @v4
171
188
if : success() || failure() # always run even if the previous step fails
172
- with :
173
- report_paths : " report.xml"
189
+ with :
190
+ name : ${{ env.REPORT_NAME }}
191
+ path : ${{ env.REPORT_NAME }}.xml
174
192
175
193
- name : File type
176
194
run : file distribution/*
@@ -188,14 +206,15 @@ jobs:
188
206
run : |
189
207
executables=( $(ls distribution) )
190
208
version=$(./distribution/print-api --version)
191
- archive="print-api-${version}-${{ runner.os }} -${{ env.ARCH }}-static-ghc-${{ matrix.ghc }}.tar.gz"
209
+ archive="print-api-${version}-alpine-3.20 -${{ env.ARCH }}-static-ghc-${{ matrix.ghc }}.tar.gz"
192
210
tar -c -z -v -f "${archive}" -C distribution "${executables[@]}"
193
211
echo "PRINTAPI_EXEC_TAR=${archive}" >> $GITHUB_ENV
212
+ echo "ARTIFACT_NAME=artifact-alpine-3.20-ghc-${{ matrix.ghc }}" >> $GITHUB_ENV
194
213
195
214
- name : Upload the executables archive
196
- uses : actions/upload-artifact@v3
215
+ uses : actions/upload-artifact@v4
197
216
with :
198
- name : artifact
217
+ name : ${{ env.ARTIFACT_NAME }}
199
218
path : ${{ env.PRINTAPI_EXEC_TAR }}
200
219
201
220
prerelease-head :
@@ -204,9 +223,10 @@ jobs:
204
223
needs : ['builds', 'build-alpine']
205
224
206
225
steps :
207
- - uses : actions/download-artifact@v3
226
+ - uses : actions/download-artifact@v4
208
227
with :
209
- name : artifact
228
+ pattern : artifact-*
229
+ merge-multiple : true
210
230
path : ./out
211
231
212
232
- name : Release
0 commit comments