53
53
echo 'matrix.cabal-version: ${{ matrix.os || env.DEFAULT_CABAL_VERSION }}'
54
54
echo 'matrix.cabal-flags: ${{ matrix.cabal-flags }}'
55
55
echo 'matrix.cabal-project-file: ${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}'
56
- echo 'matrix.cabal-skip-tests: ${{ matrix.cabal-skip-tests || false }}'
57
- echo 'matrix.cabal-skip-benchmarks: ${{ matrix.cabal-skip-benchmarks || false}}'
58
- echo 'matrix.cabal-documentation: ${{ matrix.cabal-documentation || false }}'
59
56
echo 'toJSON(matrix): ${{ toJSON(matrix) }}'
60
57
61
58
- name : 🗄️ Print CPU info
78
75
run : |
79
76
cabal configure \
80
77
--project-file="${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}" \
81
- ${{ matrix.cabal-skip-tests && '--disable-tests' || '-- enable-tests' }} \
82
- ${{ matrix.cabal-skip-benchmarks && '--disable-benchmarks' || '-- enable-benchmarks' }} \
83
- ${{ matrix.cabal-documentation && '--enable-documentation' || '-- disable-documentation' }} \
78
+ -- enable-tests \
79
+ -- enable-benchmarks \
80
+ -- disable-documentation \
84
81
--ghc-options="-Werror" \
85
82
--flag="${{ matrix.cabal-flags }}"
86
83
cat "${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}.local"
@@ -116,14 +113,12 @@ jobs:
116
113
key : ${{ steps.cache-cabal.outputs.cache-primary-key }}
117
114
118
115
- name : 🏗️ Build
119
- if : ${{ !matrix.cabal-skip-tests }}
120
116
run : |
121
117
cabal build all \
122
118
--project-file="${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}"
123
119
124
120
- name : 🧪 Test
125
121
id : test
126
- if : ${{ !matrix.cabal-skip-tests }}
127
122
run : |
128
123
cabal test all \
129
124
-j1 \
@@ -137,7 +132,7 @@ jobs:
137
132
# directory containing the golden files after running the goldens tests
138
133
# allows us to diff the expected and actual golden file contents.
139
134
- name : 📦 Upload golden files
140
- if : ${{ !matrix.cabal-skip-tests && steps.test.outcome != 'success' && always() }}
135
+ if : ${{ steps.test.outcome != 'success' && always() }}
141
136
uses : actions/upload-artifact@v4
142
137
with :
143
138
name : golden-files-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}-plan-${{ hashFiles('dist-newstyle/cache/plan.json') }}
@@ -146,28 +141,15 @@ jobs:
146
141
retention-days : 1
147
142
148
143
- name : 🛠️ Setup cabal-docspec (Linux)
149
- if : ${{ !matrix.cabal-skip-tests && runner.os == 'Linux' }}
144
+ if : ${{ runner.os == 'Linux' }}
150
145
uses : ./.github/actions/setup-cabal-docspec
151
146
152
147
- name : 🧪 Test with cabal-docspec (Linux)
153
- if : ${{ !matrix.cabal-skip-tests && runner.os == 'Linux' }}
148
+ if : ${{ runner.os == 'Linux' }}
154
149
run : ./scripts/test-cabal-docspec.sh
155
150
env :
156
151
SKIP_CABAL_BUILD : true
157
152
158
- - name : 🏗️ Build documentation
159
- if : ${{ matrix.cabal-documentation }}
160
- run : ./scripts/generate-haddock.sh
161
-
162
- - name : 📦 Upload documentation
163
- if : ${{ matrix.cabal-documentation }}
164
- uses : actions/upload-artifact@v4
165
- with :
166
- name : haddocks-${{ runner.os }}-ghc-${{ matrix.ghc-version || env.DEFAULT_GHC_VERSION }}-cabal-${{ matrix.cabal-version || env.DEFAULT_CABAL_VERSION }}
167
- path : haddocks
168
- if-no-files-found : error
169
- retention-days : 1
170
-
171
153
strategy :
172
154
fail-fast : false
173
155
matrix :
@@ -178,7 +160,6 @@ jobs:
178
160
# entry under include that assigns these keys creates a new matrix entry
179
161
cabal-flags : [""]
180
162
cabal-project-file : [""]
181
- cabal-documentation : [false]
182
163
183
164
include :
184
165
# Include builds for various special cases
@@ -188,12 +169,6 @@ jobs:
188
169
- name : " Build with cabal.project.release"
189
170
os : " ubuntu-latest"
190
171
cabal-project-file : " cabal.project.release"
191
- # Include build for documentation
192
- - name : " Build documentation"
193
- os : " ubuntu-latest"
194
- cabal-skip-tests : true
195
- cabal-skip-benchmarks : true
196
- cabal-documentation : true
197
172
198
173
# ###############################################################################
199
174
# Lint with actionlint
@@ -352,40 +327,3 @@ jobs:
352
327
353
328
- name : 🎗️ Lint with ShellCheck
354
329
run : ./scripts/lint-shellcheck.sh
355
-
356
- # ###############################################################################
357
- # Publish documentation
358
- # ###############################################################################
359
- publish-documentation :
360
- name : Publish documentation
361
- runs-on : ubuntu-latest
362
- if : ${{ github.event_name == 'push' }}
363
- needs : [build]
364
-
365
- permissions :
366
- pages : write
367
- id-token : write
368
-
369
- environment :
370
- name : github-pages
371
- url : ${{ steps.publish-pages.outputs.page_url }}
372
-
373
- steps :
374
- - name : 🛠️ Setup Pages
375
- uses : actions/configure-pages@v5
376
-
377
- - name : 📦 Download documentation
378
- uses : actions/download-artifact@v4
379
- with :
380
- # Ensure that the job that builds the documentation uses the default GHC and Cabal versions.
381
- name : haddocks-Linux-ghc-${{ env.DEFAULT_GHC_VERSION }}-cabal-${{ env.DEFAULT_CABAL_VERSION }}
382
- path : haddocks
383
-
384
- - name : 📦 Upload documentation to Pages
385
- uses : actions/upload-pages-artifact@v3
386
- with :
387
- path : haddocks
388
-
389
- - name : 🚀 Publish documentation to Pages
390
- id : publish-pages
391
- uses : actions/deploy-pages@v4
0 commit comments