Skip to content

Commit

Permalink
Update .github/workflows/build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Mar 30, 2022
1 parent 3208caa commit 6f16da6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 49 deletions.
80 changes: 32 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,66 @@ name: build
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
schedule:
- cron: '0 0 * * *'

jobs:
build:
name: ${{ matrix.os }} / Cabal ${{ matrix.cabal }} / GHC ${{ matrix.ghc }}
name: ${{ matrix.os }} / GHC ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-16.04
cabal:
- 3.2
- ubuntu-18.04
ghc:
- 7.4.1
- 7.4.2
- 7.6.1
- 7.6.2
- 7.6.3
- 7.8.1
- 7.8.2
- 7.8.3
- 7.8.4
- 7.10.1
- 7.10.2
- 7.10.3
- 8.0.1
- 8.0.2
- 8.2.1
- 8.2.2
- 8.4.1
- 8.4.2
- 8.4.3
- 8.4.4
- 8.6.1
- 8.6.2
- 8.6.3
- 8.6.4
- 8.6.5
- 8.8.1
- 8.8.2
- 8.8.3
- 8.8.4
- 8.10.1
- 8.10.2
- '7.4'
- '7.6'
- '7.8'
- '7.10'
- '8.0'
- '8.2'
- '8.4'
- '8.6'
- '8.8'
- '8.10'
- '9.0'
- '9.2'
include:
- os: macos-latest
cabal: 3.2
ghc: 8.10.2
ghc: latest
- os: windows-latest
cabal: 3.2
ghc: 8.10.2
ghc: latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
- uses: actions/checkout@v3
- uses: hspec/setup-haskell@v1
with:
cabal-version: ${{ matrix.cabal }}
ghc-version: ${{ matrix.ghc }}

- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
cabal configure --enable-tests --enable-benchmarks # NOTE: --enable-tests is necessary due to https://github.com/haskell/cabal/issues/5079
cabal build --only-dependencies
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
run: cabal build all

- name: Run tests
run: cabal test all --test-show-details=direct
env:
HSPEC_OPTIONS: --color

success:
needs: [build]
needs: build
runs-on: ubuntu-latest
steps: [run: echo success]
if: always() # this is required as GitHub considers "skipped" jobs as "passed" when checking branch protection rules

steps:
- run: exit 1
if: needs.build.result != 'success'
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ library:

tests:
spec:
defaults: hspec/hspec@master
defaults: hspec/hspec@main
dependencies: strip

0 comments on commit 6f16da6

Please sign in to comment.