Skip to content

address hlint complaint #125

address hlint complaint

address hlint complaint #125

Workflow file for this run

---
name: Haskell CI
on:
push:
branches:
- dev
- develop
- master
pull_request:
branches:
- dev
- develop
- master
permissions: read-all
jobs:
build_and_test:
strategy:
matrix:
# os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest]
include:
- os: ubuntu-latest
apt-get: graphviz texlive-base texlive-latex-base
runs-on: ${{ matrix.os }}
steps:
- name: Install ${{ matrix.os }} Packages
uses: delgurth/get-package@v6
with:
apt-get: ${{ matrix.apt-get }}
- uses: actions/checkout@v4
- name: Restore Stack on Unix
id: cache-stack-unix-restore
uses: actions/cache/restore@v4
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack-apps.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-${{ hashFiles('stack-apps.yaml') }}
${{ runner.os }}-stack-global-
if: contains(matrix.os, 'windows') == false
- name: Restore Stack on Windows
id: cache-stack-windows-restore
uses: actions/cache/restore@v4
with:
path: ~/AppData/Local/Programs/stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack-apps.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-${{ hashFiles('stack-apps.yaml') }}
${{ runner.os }}-stack-global-
if: contains(matrix.os, 'windows') == false
- name: Restore .stack-work
id: cache-stack-work-restore
uses: actions/cache/restore@v4
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack-apps.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-${{ hashFiles('stack-apps.yaml') }}
${{ 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 test --stack-yaml=stack-apps.yaml --bench --only-dependencies
set +ex
if: contains(matrix.os, 'windows') == false
- name: Install dependencies on windows
shell: powershell
run: |
stack --no-terminal test --stack-yaml=stack-apps.yaml --bench --only-dependencies
if: contains(matrix.os, 'windows')
- name: Build and test on unix
id: test-unix
run: |
set -ex
# shellcheck disable=SC2086
stack --no-terminal test --stack-yaml=stack-apps.yaml --coverage \
--bench --no-run-benchmarks --haddock --no-haddock-deps \
--test-arguments="--skip-needs-tuning --times --maximum-generated-tests=50"
set +ex
if: contains(matrix.os, 'windows') == false
- name: Build and test on windows
id: test-windows
shell: powershell
run: |
stack --no-terminal test --stack-yaml=stack-apps.yaml --coverage \
--bench --no-run-benchmarks --haddock --no-haddock-deps \
--test-arguments="--skip-needs-tuning --times --maximum-generated-tests=50"
if: contains(matrix.os, 'windows')
- name: Archive test artifacts
uses: actions/upload-artifact@v4
with:
name: test-results
path: artifacts
if: ${{ failure() && (steps.test-unix.conclusion == 'failure' || steps.test-windows.conclusion == 'failure') }}
- name: Cache Stack on Unix
id: cache-stack-unix-save
uses: actions/cache/save@v4
with:
path: ~/.stack
key: ${{ steps.cache-stack-unix-restore.outputs.cache-primary-key }}
if: >-
contains(matrix.os, 'windows') == false
&& steps.cache-stack-unix-restore.outputs.cache-hit != 'true'
- name: Cache Stack on Windows
id: cache-stack-windows-save
uses: actions/cache/save@v4
with:
path: ~/AppData/Local/Programs/stack
key: ${{ steps.cache-stack-windows-restore.outputs.cache-primary-key }}
if: >-
contains(matrix.os, 'windows')
&& steps.cache-stack-windows-restore.outputs.cache-hit != 'true'
- name: Cache .stack-work
id: cache-stack-work-save
uses: actions/cache/save@v4
with:
path: .stack-work
key: ${{ steps.cache-stack-work-restore.outputs.cache-primary-key }}
if: >-
steps.cache-stack-work-restore.outputs.cache-hit != 'true'