witch/.github/workflows/ci.yaml
2020-11-14 15:12:40 -05:00

47 lines
1.5 KiB
YAML

name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
release:
types:
- created
jobs:
build:
strategy:
matrix:
os: [ ubuntu-18.04 ]
ghc: [ '8.10.2', '8.8.4', '8.6.5' ]
cabal: [ '3.2.0.0' ]
include:
- { os: macos-10.15, ghc: 8.10.2, cabal: 3.2.0.0 }
- { os: windows-2019, ghc: 8.10.2, cabal: 3.2.0.0 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- id: setup-haskell
uses: actions/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: cabal freeze && cat cabal.project.freeze
- uses: actions/cache@v2
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
${{ matrix.os }}-${{ matrix.ghc }}-
- run: cabal test --test-show-details direct
- run: cabal sdist
- uses: actions/upload-artifact@v2
with:
path: dist-newstyle/sdist/witch-*.tar.gz
name: witch-${{ github.sha }}.tar.gz
- run: cabal check
- if: github.event_name == 'release'
run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' dist-newstyle/sdist/witch-*.tar.gz