-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fdcbeb
commit aefe397
Showing
1 changed file
with
35 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,54 @@ | ||
name: Haskell CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: {} | ||
branches: [ 'master', 'ci' ] | ||
pull_request: | ||
branches: [ 'master' ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
ghc: ['8.0', '8.2', '8.4', '8.6', '8.8', '8.10'] | ||
exclude: | ||
- os: windows-latest | ||
ghc: "8.0" | ||
- os: windows-latest | ||
ghc: "8.2" | ||
- os: windows-latest | ||
ghc: "8.4" | ||
os: [ 'ubuntu-latest', 'macOS-latest', 'windows-latest' ] | ||
ghc: [ '8.10', '9.0', '9.2' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: haskell/actions/setup@v2 | ||
id: setup-haskell-cabal | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: '3.2' | ||
- name: Update cabal package database | ||
run: | | ||
cabal update | ||
cabal freeze | ||
- uses: actions/cache@v3 | ||
name: Cache cabal stuff | ||
cabal-version: '3.8' | ||
|
||
- name: Cache | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-cabal | ||
with: | ||
path: | | ||
${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
dist-newstyle | ||
key: cache-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | ||
path: ~/.cabal | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | ||
restore-keys: | | ||
cache-${{ matrix.os }}-${{ matrix.ghc }}- | ||
- name: Build | ||
run: | | ||
cabal install hspec-discover | ||
cabal build --disable-tests --disable-benchmarks all | ||
- name: Test | ||
run: | | ||
cabal test | ||
- name: Haddock | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: | | ||
cabal haddock | ||
- name: SDist | ||
cabal update | ||
cabal build --only-dependencies --enable-tests --disable-benchmarks | ||
- name: Build | ||
run: cabal build --enable-tests --disable-benchmarks all | ||
|
||
- name: Run tests | ||
run: cabal test --test-show-details=streaming | ||
|
||
- name: Run doctest | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
cabal sdist all | ||
cabal install doctest --overwrite-policy=always | ||
cabal repl --build-depends=QuickCheck --with-ghc=doctest |