Skip to content

Commit

Permalink
updating github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Mar 15, 2023
1 parent 7fdcbeb commit aefe397
Showing 1 changed file with 35 additions and 36 deletions.
71 changes: 35 additions & 36 deletions .github/workflows/main.yml
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

0 comments on commit aefe397

Please sign in to comment.