pandoc/.github/workflows/ci.yml

251 lines
7.1 KiB
YAML

name: CI tests
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/**'
jobs:
linux:
runs-on: ubuntu-18.04
strategy:
fail-fast: true
matrix:
versions:
- ghc: '8.0.2'
cabal: '2.2'
- 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'
cabal: '3.2'
steps:
- uses: actions/checkout@v2
# need to install older cabal/ghc versions from ppa repository
- name: Install recent cabal/ghc
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.versions.ghc }}
cabal-version: ${{ matrix.versions.cabal }}
# declare/restore cached things
# caching doesn't work for scheduled runs yet
# https://github.com/actions/cache/issues/63
- name: Cache cabal global package db
id: cabal-global
uses: actions/cache@v2
with:
path: |
~/.cabal
key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }}
- 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
- name: Install dependencies
run: |
v2=$([ "${{ matrix.versions.cabal }}" = "2.2" ] && printf 'new' || printf 'v2')
cabal $v2-update
cabal $v2-build --dependencies-only --enable-tests --disable-optimization
- name: Build and test
run: |
v2=$([ "${{ matrix.versions.cabal }}" = "2.2" ] && printf 'new' || printf 'v2')
testopts=$([ "${{ matrix.versions.cabal }}" != "2.2" ] && [ "${{ matrix.versions.cabal }}" != "2.4" ] && printf '--test-option=--hide-successes')
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 $testopts
windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
# We should have ghc 8.10, cabal, stack pre-installed
# - uses: haskell/actions/setup@v1
# with:
# enable-stack: true
# stack-version: 'latest'
# 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
uses: actions/cache@v2
with:
path: |
C:\Users\runneradmin\AppData\Roaming\stack\
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('stack.yaml') }}
# stack's local package dbs for the project and each package
# - name: Cache .stack-work
# uses: actions/cache@v1
# with:
# path: .stack-work
# key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}
# restore-keys: ${{ runner.os }}-stack-work
- name: Install dependencies
run: |
stack update
stack install happy
stack test --dependencies-only --fast
- name: Build and test
shell: cmd
run: |
stack test --fast --test-arguments=--hide-successes
macos:
runs-on: macOS-10.15
strategy:
fail-fast: true
matrix:
versions:
- ghc: '8.8.4'
cabal: '3.2'
steps:
- uses: actions/checkout@v2
- name: Install recent cabal/ghc
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.versions.ghc }}
cabal-version: ${{ matrix.versions.cabal }}
# declare/restore cached things
# caching doesn't work for scheduled runs yet
# https://github.com/actions/cache/issues/63
- name: Cache cabal global package db
id: cabal-global
uses: actions/cache@v2
with:
path: |
~/.cabal
key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }}
- 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
- name: Install dependencies
run: |
cabal v2-update
cabal v2-build --dependencies-only --enable-tests --disable-optimization
- name: Build and test
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
benchmark:
runs-on: ubuntu-18.04
strategy:
fail-fast: true
matrix:
versions:
- ghc: '8.8.4'
cabal: '3.2'
- ghc: '8.10.2'
cabal: '3.2'
steps:
- uses: actions/checkout@v2
# need to install older cabal/ghc versions from ppa repository
- name: Install recent cabal/ghc
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.versions.ghc }}
cabal-version: ${{ matrix.versions.cabal }}
# declare/restore cached things
# caching doesn't work for scheduled runs yet
# https://github.com/actions/cache/issues/63
- name: Cache cabal global package db
id: cabal-global
uses: actions/cache@v2
with:
path: |
~/.cabal
key: benchmark-${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }}
- name: Cache cabal work
id: cabal-local
uses: actions/cache@v2
with:
path: |
dist-newstyle
key: benchmark-${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local
- name: Install dependencies
run: |
v2=$([ "${{ matrix.versions.cabal }}" = "2.2" ] && printf 'new' || printf 'v2')
cabal $v2-update
cabal $v2-build --dependencies-only --enable-optimization=1 --enable-benchmarks --disable-tests
- name: Build and test
run: |
v2=$([ "${{ matrix.versions.cabal }}" = "2.2" ] && printf 'new' || printf 'v2')
cabal $v2-build --enable-optimization=1 --enable-benchmarks --disable-tests 2>&1 | tee build.log
# fail if warnings in local build
! grep -q ": *[Ww]arning:" build.log || exit 1
cabal $v2-bench --enable-optimization=1 --benchmark-options='--timeout=6 +RTS -T -RTS'