1010jobs :
1111
1212 build_test_doc :
13- name : Build, Test, API docs
14- runs-on : ubuntu-latest
13+ name : Test & Docs (${{ matrix.ghc-version }} on ${{ matrix.os }})
14+ runs-on : ${{ matrix.os }}
15+ strategy :
16+ fail-fast : false
17+ matrix :
18+ os : [ubuntu-latest]
19+ ghc-version : ['9.2', '9.4', '9.6', '9.8', '9.10', '9.12']
20+ include :
21+ - os : windows-latest
22+ ghc-version : ' 9.6'
23+ - os : macos-latest
24+ ghc-version : ' 9.6'
25+
1526 steps :
1627
1728 - name : Checkout repository content
1829 uses : actions/checkout@v4
1930
20- - name : Set up Haskell
31+ - name : Set up GHC ${{ matrix.ghc-version }}
2132 uses : haskell-actions/setup@v2
2233 id : setup
2334 with :
24- ghc-version : ' 9.2.7'
25- cabal-version : ' 3.6.2.0'
35+ ghc-version : ${{ matrix.ghc-version }}
2636
2737 - name : Configure the build
2838 # generates dist-newstyle/cache/plan.json
@@ -32,10 +42,12 @@ jobs:
3242
3343 - name : Configure cache
3444 uses : actions/cache@v4
45+ env :
46+ key : ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-${{ steps.setup.outputs.cabal-version }}
3547 with :
3648 path : ${{ steps.setup.outputs.cabal-store }}
37- key : cabal -${{ hashFiles('**/plan.json') }}
38- restore-keys : cabal -
49+ key : ${{ env.key }}-plan -${{ hashFiles('**/plan.json') }}
50+ restore-keys : ${{ env.key }}-plan -
3951
4052 - name : Install dependencies
4153 run : cabal build --only-dependencies all
@@ -47,18 +59,22 @@ jobs:
4759 run : cabal test --test-show-details=streaming all
4860
4961 - name : Generate haddock API docs
62+ if : matrix.os == 'ubuntu-latest' && matrix.ghc-version == '9.6'
5063 run : cabal haddock --builddir=$HADDOCK_BUILD_DIR --haddock-hyperlinked-source --haddock-html-location='https://hackage.haskell.org/package/$pkg-$version/docs'
5164
5265 - name : Find generated HTML
66+ if : matrix.os == 'ubuntu-latest' && matrix.ghc-version == '9.6'
5367 run : mv $(find $HADDOCK_BUILD_DIR -wholename '*doc/html/circular-enum' | head -n 1) $HADDOCK_DIR
5468
5569 - name : Store generated API docs
70+ if : matrix.os == 'ubuntu-latest' && matrix.ghc-version == '9.6'
5671 uses : actions/upload-artifact@v4
5772 with :
5873 name : Haddock API docs
5974 path : ${{ env.HADDOCK_DIR }}
6075
6176 - name : Prepare API docs for pages deployment
77+ if : matrix.os == 'ubuntu-latest' && matrix.ghc-version == '9.6'
6278 uses : actions/upload-pages-artifact@v3
6379 with :
6480 path : ${{ env.HADDOCK_DIR }}
0 commit comments