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:
|
2020-06-24 00:48:37 +03:00
|
|
|
ghc: ["8.8.3"]
|
|
|
|
cabal: ["3.2.0.0"]
|
2019-12-13 22:06:45 +03:00
|
|
|
|
|
|
|
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 }}
|
|
|
|
|
2019-12-17 22:12:21 +03:00
|
|
|
- uses: actions/cache@v1
|
2020-05-20 16:06:33 +03:00
|
|
|
id: cache-cabal
|
|
|
|
name: Cache Cabal artifacts
|
2019-12-13 22:06:45 +03:00
|
|
|
with:
|
2020-05-20 16:06:33 +03:00
|
|
|
path: dist-cache
|
2020-05-20 18:52:23 +03:00
|
|
|
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache-${{ hashFiles('**/*.cabal') }}
|
2020-05-20 21:09:35 +03:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache-
|
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
|
2020-05-20 18:44:39 +03:00
|
|
|
${{ runner.os }}-${{ matrix.ghc }}-
|
2020-05-20 21:09:35 +03:00
|
|
|
${{ runner.os }}-
|
2019-12-13 22:06:45 +03:00
|
|
|
|
2020-05-20 16:06:33 +03:00
|
|
|
- name: Get cabal-cache
|
|
|
|
run: |
|
|
|
|
curl -L https://github.com/haskell-works/cabal-cache/releases/download/v1.0.1.8/cabal-cache_x86_64_linux.tar.gz > ./cc.tar.gz
|
|
|
|
tar -xvf ./cc.tar.gz
|
2020-01-22 01:31:49 +03:00
|
|
|
|
2020-05-20 16:06:33 +03:00
|
|
|
- name: Configure project
|
2019-12-13 22:06:45 +03:00
|
|
|
run: |
|
2020-05-20 17:38:28 +03:00
|
|
|
cabal v2-update
|
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
|
2020-05-20 16:06:33 +03:00
|
|
|
|
|
|
|
- name: Restore from cache
|
2020-05-20 21:12:47 +03:00
|
|
|
run: ./cabal-cache sync-from-archive --threads=2 --archive-uri=dist-cache || true
|
2019-12-13 22:06:45 +03:00
|
|
|
|
|
|
|
- name: Build & test
|
|
|
|
run: |
|
2020-06-26 21:14:40 +03:00
|
|
|
cabal v2-build --project-file=cabal.project.ci semantic:exe:semantic
|
2020-01-16 22:18:14 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic:test
|
2020-07-07 17:27:25 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-tags:test
|
2020-03-20 20:29:19 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-codeql:test
|
2020-01-16 22:18:14 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-core:test
|
2020-02-20 21:38:52 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-go:test
|
2020-02-21 01:22:32 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-java:test
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-json:test
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-python:test
|
2020-06-08 18:29:16 +03:00
|
|
|
# cabal v2-run --project-file=cabal.project.ci semantic-python:test:compiling
|
2020-06-08 19:04:22 +03:00
|
|
|
# cabal v2-run --project-file=cabal.project.ci semantic-python:test:graphing
|
2020-02-21 01:22:32 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-ruby:test
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-tsx:test
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-typescript:test
|
2020-07-06 18:03:41 +03:00
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-source:test
|
|
|
|
cabal v2-run --project-file=cabal.project.ci semantic-source:doctest -- semantic-source/src
|
2020-05-20 16:06:33 +03:00
|
|
|
|
|
|
|
- name: Write out cache
|
|
|
|
run: ./cabal-cache sync-to-archive --threads=2 --archive-uri=dist-cache
|