2019-12-13 22:06:45 +03:00
|
|
|
name: Haskell CI
|
|
|
|
|
2019-12-17 23:02:03 +03:00
|
|
|
on:
|
|
|
|
# Trigger the workflow on push or pull request,
|
|
|
|
# but only for the master branch
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
2019-12-13 22:06:45 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ghc ${{ matrix.ghc }}
|
2020-01-14 23:45:00 +03:00
|
|
|
runs-on: ubuntu-latest
|
2019-12-13 22:06:45 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
ghc: ["8.8.1"]
|
|
|
|
cabal: ["3.0"]
|
|
|
|
|
|
|
|
steps:
|
2020-01-14 23:45:00 +03:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-18 03:08:25 +03:00
|
|
|
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
2019-12-13 22:06:45 +03:00
|
|
|
|
|
|
|
- uses: actions/setup-haskell@v1
|
|
|
|
name: Setup Haskell
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
cabal-version: ${{ matrix.cabal }}
|
|
|
|
|
2020-01-22 01:53:50 +03:00
|
|
|
- uses: actions/cache@v1
|
|
|
|
name: Cache ~/.cabal/packages
|
|
|
|
with:
|
|
|
|
path: ~/.cabal/packages
|
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-packages
|
|
|
|
|
2019-12-17 22:12:21 +03:00
|
|
|
- uses: actions/cache@v1
|
2019-12-13 22:06:45 +03:00
|
|
|
name: Cache ~/.cabal/store
|
|
|
|
with:
|
|
|
|
path: ~/.cabal/store
|
2020-02-07 01:17:09 +03:00
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-v10-cabal-store
|
2019-12-17 22:12:21 +03:00
|
|
|
|
|
|
|
- uses: actions/cache@v1
|
2019-12-13 22:06:45 +03:00
|
|
|
name: Cache dist-newstyle
|
|
|
|
with:
|
|
|
|
path: dist-newstyle
|
2020-01-14 23:45:00 +03:00
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-semantic-dist
|
2019-12-13 22:06:45 +03:00
|
|
|
|
2020-01-22 01:31:49 +03:00
|
|
|
# - name: hlint
|
|
|
|
# run: |
|
|
|
|
# test -f dist-newstyle/hlint || cabal install hlint --installdir=dist-newstyle
|
|
|
|
# dist-newstyle/hlint src semantic-python
|
|
|
|
|
2019-12-13 22:06:45 +03:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2020-01-30 21:26:26 +03:00
|
|
|
script/bootstrap
|
2020-01-16 22:18:14 +03:00
|
|
|
cabal v2-configure --project-file=cabal.project.ci --disable-optimization --enable-benchmarks --enable-tests --write-ghc-environment-files=always -j2
|
|
|
|
cabal v2-build --project-file=cabal.project.ci all --only-dependencies
|
2019-12-13 22:06:45 +03:00
|
|
|
|
|
|
|
- name: Build & test
|
|
|
|
run: |
|
2020-01-16 22:18:14 +03:00
|
|
|
cabal v2-build --project-file=cabal.project.ci
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic:test
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-core:test
|
2020-01-17 19:24:07 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-python:test:compiling
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-python:test:graphing
|
2020-01-16 22:02:36 +03:00
|
|
|
cd semantic-source; cabal v2-run --project-file=cabal.project.ci semantic-source:test; cd ..
|
|
|
|
cd semantic-source; cabal v2-run --project-file=cabal.project.ci semantic-source:doctest -- src; cd ..
|