Skip to content

Build

Build #250

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
types:
- synchronize
- opened
- reopened
push:
branches:
- master
schedule:
# Run once per day (at UTC 00:00) to maintain cache:
- cron: 0 0 * * *
jobs:
build:
name: ${{ matrix.os }}-ghc-${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - macOS-latest
# - windows-latest
cabal:
- 3.6.2.0
ghc:
- 8.10.7
- 9.0.2
- 9.2.5
- 9.4.4
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Environment
uses: haskell/actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure
run: >
cabal configure
--enable-tests
--enable-benchmarks
--enable-documentation
--test-show-details=direct
--write-ghc-environment-files=always
- name: Freeze
run: |
cabal freeze
- name: Cache
uses: actions/cache@v3
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: |
${{ runner.os }}-\
${{ matrix.ghc }}-\
${{ hashFiles('cabal.project.freeze') }}
- name: Dependencies
run: |
ghc --version
cabal --version
cabal build all --only-dependencies
- name: Build
run: |
cabal build all
- name: Test
run: |
cabal test all
- name: Documentation
if: |
false
&& matrix.os == 'ubuntu-latest'
&& matrix.ghc == '8.10.7'
run: >
cabal haddock
--haddock-hyperlink-source
--haddock-quickjump
--haddock-html-location
'https://hackage.haskell.org/package/$pkg-$version/docs'
mv dist-newstyle/build/*/*/*/doc/html/* gh-pages
touch gh-pages/.nojekyll
- name: Deploy
if: |
false
&& github.ref == 'refs/heads/master'
&& matrix.os == 'ubuntu-latest'
&& matrix.ghc == '8.10.7'
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages
folder: gh-pages