pandoc/.github/workflows/ci.yml

189 lines
4.8 KiB
YAML
Raw Normal View History

name: CI tests
2019-09-13 08:04:58 +02:00
on:
push:
branches:
- '*'
- '!rc/*'
paths-ignore:
- 'doc/**'
- 'MANUAL.txt'
- '*.md'
- 'RELEASE_CHECKLIST'
- 'BUGS'
- 'changelog'
- 'README.template'
- 'appveyor.yml'
- 'tools/**'
- 'linux/**'
- 'macos/**'
- 'windows/**'
- 'man/**'
pull_request:
paths-ignore:
- 'doc/**'
- 'MANUAL.txt'
- '*.md'
- 'RELEASE_CHECKLIST'
- 'BUGS'
- 'changelog'
- 'README.template'
- 'appveyor.yml'
- 'tools/**'
- 'linux/**'
- 'macos/**'
- 'windows/**'
- 'man/**'
2019-09-13 08:04:58 +02:00
jobs:
2019-09-13 19:54:55 +02:00
linux:
2020-06-15 01:45:01 +02:00
runs-on: ubuntu-18.04
strategy:
fail-fast: true
matrix:
versions:
2020-07-24 06:36:06 +02:00
- ghc: '8.0.2'
cabal: '2.4'
- ghc: '8.2.2'
cabal: '2.4'
- ghc: '8.4.4'
cabal: '2.4'
- ghc: '8.6.5'
cabal: '3.2'
- ghc: '8.8.4'
cabal: '3.2'
- ghc: '8.10.2'
2020-04-17 18:51:33 +02:00
cabal: '3.2'
2019-09-13 08:04:58 +02:00
steps:
- uses: actions/checkout@v1
2020-04-13 06:53:38 +02:00
# need to install older cabal/ghc versions from ppa repository
- name: Install recent cabal/ghc
2020-07-13 18:28:19 +02:00
uses: actions/setup-haskell@v1.1
with:
ghc-version: ${{ matrix.versions.ghc }}
cabal-version: ${{ matrix.versions.cabal }}
2020-04-13 06:53:38 +02:00
# declare/restore cached things
# caching doesn't work for scheduled runs yet
# https://github.com/actions/cache/issues/63
2020-04-14 08:04:06 +02:00
- name: Cache cabal global package db
2020-04-13 06:53:38 +02:00
id: cabal-global
2020-08-15 20:49:43 +02:00
uses: actions/cache@v2
2020-04-13 06:53:38 +02:00
with:
2020-08-15 20:49:43 +02:00
path: |
~/.cabal
2020-04-14 08:04:06 +02:00
key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }}
- name: Cache cabal work
id: cabal-local
2020-08-15 20:49:43 +02:00
uses: actions/cache@v2
2020-04-14 08:04:06 +02:00
with:
2020-08-15 20:49:43 +02:00
path: |
dist-newstyle
2020-04-14 08:04:06 +02:00
key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local
2020-04-13 06:53:38 +02:00
2019-09-13 08:04:58 +02:00
- name: Install dependencies
2019-09-13 18:24:14 +02:00
run: |
cabal v2-update
cabal v2-build --dependencies-only --enable-tests --disable-optimization
- name: Build and test
2019-09-13 18:24:14 +02:00
run: |
cabal v2-build --enable-tests --disable-optimization 2>&1 | tee build.log
# fail if warnings in local build
! grep -q ": *[Ww]arning:" build.log || exit 1
cabal v2-test --disable-optimization
2019-09-13 19:54:55 +02:00
windows:
runs-on: windows-2019
2019-09-13 19:54:55 +02:00
steps:
- uses: actions/checkout@v1
- name: Install stack
shell: cmd
run: |
choco install haskell-stack
2020-04-13 00:52:14 +02:00
# declare/restore cached things
# caching doesn't work for scheduled runs yet
# https://github.com/actions/cache/issues/63
- name: Cache stack global package db
id: stack-global-package-db
2020-08-15 20:49:43 +02:00
uses: actions/cache@v2
2020-04-13 00:52:14 +02:00
with:
2020-08-15 20:49:43 +02:00
path: |
C:\Users\runneradmin\AppData\Roaming\stack\
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('stack.yaml') }}
2020-04-13 00:52:14 +02:00
# stack's local package dbs for the project and each package
2020-04-19 06:02:06 +02:00
# - name: Cache .stack-work
# uses: actions/cache@v1
# with:
# path: .stack-work
# key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}
2020-04-19 06:02:06 +02:00
# restore-keys: ${{ runner.os }}-stack-work
2020-04-13 00:52:14 +02:00
- name: Install dependencies
run: |
stack update
stack test --dependencies-only --fast
2019-09-13 19:54:55 +02:00
- name: Build and test
shell: cmd
run: |
stack test --fast --test-arguments=--hide-successes
2019-09-17 06:44:54 +02:00
macos:
runs-on: macOS-10.15
2020-09-10 18:44:12 +02:00
strategy:
fail-fast: true
matrix:
versions:
- ghc: '8.10.2'
2020-09-10 18:44:12 +02:00
cabal: '3.2'
2019-09-17 06:44:54 +02:00
steps:
- uses: actions/checkout@v1
2020-09-10 18:44:12 +02:00
- name: Install recent cabal/ghc
uses: actions/setup-haskell@v1.1
with:
ghc-version: ${{ matrix.versions.ghc }}
cabal-version: ${{ matrix.versions.cabal }}
2020-04-13 00:27:30 +02:00
# declare/restore cached things
2020-09-10 18:44:12 +02:00
# caching doesn't work for scheduled runs yet
# https://github.com/actions/cache/issues/63
2020-04-13 00:27:30 +02:00
2020-09-10 18:44:12 +02:00
- name: Cache cabal global package db
id: cabal-global
2020-08-15 20:49:43 +02:00
uses: actions/cache@v2
2020-04-13 00:27:30 +02:00
with:
2020-08-15 20:49:43 +02:00
path: |
2020-09-10 18:44:12 +02:00
~/.cabal
key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }}
2020-04-13 00:27:30 +02:00
2020-09-10 18:44:12 +02:00
- name: Cache cabal work
id: cabal-local
uses: actions/cache@v2
with:
path: |
dist-newstyle
key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local
2020-04-13 00:27:30 +02:00
2019-09-17 06:44:54 +02:00
- name: Install dependencies
run: |
2020-09-10 18:44:12 +02:00
cabal v2-update
cabal v2-build --dependencies-only --enable-tests --disable-optimization
2019-09-17 06:44:54 +02:00
- name: Build and test
run: |
2020-09-10 18:44:12 +02:00
cabal v2-build --enable-tests --disable-optimization 2>&1 | tee build.log
# fail if warnings in local build
! grep -q ": *[Ww]arning:" build.log || exit 1
cabal v2-test --disable-optimization