5353 echo 'matrix.cabal-version: ${{ matrix.os || env.DEFAULT_CABAL_VERSION }}'
5454 echo 'matrix.cabal-flags: ${{ matrix.cabal-flags }}'
5555 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 }}'
5956 echo 'toJSON(matrix): ${{ toJSON(matrix) }}'
6057
6158 - name : 🗄️ Print CPU info
7875 run : |
7976 cabal configure \
8077 --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 \
8481 --ghc-options="-Werror" \
8582 --flag="${{ matrix.cabal-flags }}"
8683 cat "${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}.local"
@@ -116,14 +113,12 @@ jobs:
116113 key : ${{ steps.cache-cabal.outputs.cache-primary-key }}
117114
118115 - name : 🏗️ Build
119- if : ${{ !matrix.cabal-skip-tests }}
120116 run : |
121117 cabal build all \
122118 --project-file="${{ matrix.cabal-project-file || env.DEFAULT_CABAL_PROJECT_FILE }}"
123119
124120 - name : 🧪 Test
125121 id : test
126- if : ${{ !matrix.cabal-skip-tests }}
127122 run : |
128123 cabal test all \
129124 -j1 \
@@ -137,7 +132,7 @@ jobs:
137132 # directory containing the golden files after running the goldens tests
138133 # allows us to diff the expected and actual golden file contents.
139134 - name : 📦 Upload golden files
140- if : ${{ !matrix.cabal-skip-tests && steps.test.outcome != 'success' && always() }}
135+ if : ${{ steps.test.outcome != 'success' && always() }}
141136 uses : actions/upload-artifact@v4
142137 with :
143138 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:
146141 retention-days : 1
147142
148143 - name : 🛠️ Setup cabal-docspec (Linux)
149- if : ${{ !matrix.cabal-skip-tests && runner.os == 'Linux' }}
144+ if : ${{ runner.os == 'Linux' }}
150145 uses : ./.github/actions/setup-cabal-docspec
151146
152147 - name : 🧪 Test with cabal-docspec (Linux)
153- if : ${{ !matrix.cabal-skip-tests && runner.os == 'Linux' }}
148+ if : ${{ runner.os == 'Linux' }}
154149 run : ./scripts/test-cabal-docspec.sh
155150 env :
156151 SKIP_CABAL_BUILD : true
157152
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-
171153 strategy :
172154 fail-fast : false
173155 matrix :
@@ -178,7 +160,6 @@ jobs:
178160 # entry under include that assigns these keys creates a new matrix entry
179161 cabal-flags : [""]
180162 cabal-project-file : [""]
181- cabal-documentation : [false]
182163
183164 include :
184165 # Include builds for various special cases
@@ -188,12 +169,6 @@ jobs:
188169 - name : " Build with cabal.project.release"
189170 os : " ubuntu-latest"
190171 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
197172
198173 # ###############################################################################
199174 # Lint with actionlint
@@ -352,40 +327,3 @@ jobs:
352327
353328 - name : 🎗️ Lint with ShellCheck
354329 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