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.2.2' cabal: '2.4' prefix: 'v2-' cabalopts: '' testopts: '' - ghc: '8.4.4' cabal: '2.4' prefix: 'v2-' cabalopts: '-f-embed_data_files' testopts: '' - ghc: '8.6.5' cabal: '3.2' prefix: '' cabalopts: '' testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - ghc: '8.8.4' cabal: '3.2' prefix: '' cabalopts: '' testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - ghc: '8.10.4' cabal: '3.2' prefix: '' cabalopts: '-ftrypandoc' testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - ghc: '9.0.1' cabal: '3.4' prefix: '' cabalopts: '' testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' steps: - uses: actions/checkout@v2 # needed by memory - name: Install numa run: sudo apt-get install libnuma-dev # 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: | cabal ${{ matrix.versions.prefix }}update cabal ${{ matrix.versions.prefix }}build ${{ matrix.versions.cabalopts }} --dependencies-only --enable-tests --disable-optimization - name: Build and test run: | cabal ${{ matrix.versions.prefix }}build ${{ matrix.versions.cabalopts }} --enable-tests --disable-optimization 2>&1 | tee build.log # fail if warnings in local build ! grep -q ": *[Ww]arning:" build.log || exit 1 cabal ${{ matrix.versions.prefix }}test ${{ matrix.versions.cabalopts }} --disable-optimization ${{ matrix.versions.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 --ansi-tricks=false" 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 --test-option=--hide-successes --test-option=--ansi-tricks=false 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'