provide functions for producing output allowing abortion #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Haskell CI | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
plan: | |
- {resolver: lts-18.28} | |
- {resolver: lts-19.33} | |
- {resolver: lts-20.26} | |
- {resolver: lts-21.25} | |
- {resolver: lts-22.18} | |
- {resolver: lts-23.5} | |
- {resolver: nightly, stack-yaml: '--stack-yaml=nightly-stack.yaml'} | |
exclude: | |
- os: macOS-latest | |
plan: {resolver: lts-18.28} | |
- os: macOS-latest | |
plan: {resolver: lts-19.33} | |
runs-on: ${{ matrix.os }} | |
steps: | |
# - name: Install ${{ matrix.os }} Packages | |
# uses: delgurth/[email protected] | |
# with: | |
# apt-get: ${{ matrix.apt-get }} | |
# brew: ${{ matrix.brew }} | |
- uses: actions/checkout@v4 | |
- name: Restore ~/.stack cache | |
id: restore-stack | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('nightly-stack.yaml') }}-${{ hashFiles('package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('nightly-stack.yaml') }} | |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }} | |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }} | |
${{ runner.os }}-stack-global- | |
if: contains(matrix.os, 'windows') == false | |
- name: Restore %APPDATA%\stack %LOCALAPPDATA%\Programs\stack cache | |
id: restore-stack-windows | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~\AppData\Roaming\stack | |
~\AppData\Local\Programs\stack | |
key: ${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('nightly-stack.yaml') }}-${{ hashFiles('package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('nightly-stack.yaml') }} | |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }} | |
${{ runner.os }}-stack-global-${{ matrix.plan.resolver }} | |
${{ runner.os }}-stack-global- | |
if: contains(matrix.os, 'windows') | |
- name: Restore .stack-work cache | |
id: restore-stack-work | |
uses: actions/cache/restore@v4 | |
with: | |
path: .stack-work | |
key: | |
${{ runner.os }}-stack-work-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('nightly-stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }} | |
restore-keys: | | |
${{ runner.os }}-stack-work-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('nightly-stack.yaml') }} | |
${{ runner.os }}-stack-work-${{ matrix.plan.resolver }}-${{ hashFiles('stack.yaml') }} | |
${{ runner.os }}-stack-work-${{ matrix.plan.resolver }} | |
${{ runner.os }}-stack-work- | |
- name: Setup stack | |
uses: haskell-actions/setup@v2 | |
with: | |
enable-stack: true | |
stack-no-global: true | |
- name: Install dependencies on unix | |
run: | | |
set -ex | |
# shellcheck disable=SC2086 | |
stack --no-terminal --install-ghc $RES $YML test --bench --only-dependencies | |
set +ex | |
env: | |
RES: "--resolver=${{ matrix.plan.resolver }}" | |
YML: "${{ matrix.plan.stack-yaml }}" | |
if: contains(matrix.os, 'windows') == false | |
- name: Install dependencies on windows | |
shell: powershell | |
run: | | |
stack --no-terminal -j 1 --install-ghc ${env:RES} ${env:YML} test --bench --only-dependencies | |
env: | |
RES: "--resolver=${{ matrix.plan.resolver }}" | |
YML: "${{ matrix.plan.stack-yaml }}" | |
if: contains(matrix.os, 'windows') | |
- name: Build on unix | |
run: | | |
set -ex | |
# shellcheck disable=SC2086 | |
stack --no-terminal --install-ghc test $RES $YML --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps | |
set +ex | |
env: | |
RES: "--resolver=${{ matrix.plan.resolver }}" | |
YML: "${{ matrix.plan.stack-yaml }}" | |
if: contains(matrix.os, 'windows') == false | |
- name: Build on windows | |
shell: powershell | |
run: | | |
stack --no-terminal --install-ghc test ${env:RES} ${env:YML} --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps | |
env: | |
RES: "--resolver=${{ matrix.plan.resolver }}" | |
YML: "${{ matrix.plan.stack-yaml }}" | |
if: contains(matrix.os, 'windows') | |
- name: Cache ~/.stack | |
uses: actions/cache/save@v4 | |
if: contains(matrix.os, 'windows') == false && always() && steps.restore-stack.outputs.cache-hit != 'true' && steps.restore-stack-work.outputs.cache-hit != 'true' | |
with: | |
path: ~/.stack | |
key: ${{ steps.restore-stack.outputs.cache-primary-key }} | |
- name: Cache %APPDATA%\stack %LOCALAPPDATA%\Programs\stack | |
uses: actions/cache/save@v4 | |
if: contains(matrix.os, 'windows') && always() && steps.restore-stack-windows.outputs.cache-hit != 'true' && steps.restore-stack-work.outputs.cache-hit != 'true' | |
with: | |
path: | | |
~\AppData\Roaming\stack | |
~\AppData\Local\Programs\stack | |
key: ${{ steps.restore-stack-windows.outputs.cache-primary-key }} | |
- name: Cache .stack-work | |
uses: actions/cache/save@v4 | |
with: | |
path: .stack-work | |
key: ${{ steps.restore-stack-work.outputs.cache-primary-key }} |