Skip to content

ci: fix

ci: fix #65

Workflow file for this run

name: shelltestrunner CI
on:
push:
paths:
- '.github/workflows/**'
- 'stack*'
- 'src/**'
- 'tests/**'
- '!**.md'
- '!**.1'
- '!**.5'
- '!**.info'
- '!**.txt'
pull_request:
paths:
- '.github/workflows/**'
- 'stack*'
- 'src/**'
- 'tests/**'
- '!**.md'
- '!**.1'
- '!**.5'
- '!**.info'
- '!**.txt'
# Scheduled workflows run on the latest commit on the default or base branch. (master)
# schedule:
# - cron: "0 07 * * 0" # sunday midnight pacific
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plan:
- { ghc: "912", stack: "stack --stack-yaml=stack912.yaml" }
steps:
- name: Check out
uses: actions/checkout@v4
- name: Cache stack global package db
id: stack-global
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}
- name: Cache stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v4
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}
- name: Cache .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}
# - name: Install stack
# run: |
# mkdir -p ~/.local/bin
# export PATH=~/.local/bin:$PATH
# # curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
# if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
# stack --version
# - name: Install GHC
# env:
# stack: ${{ matrix.plan.stack }}
# run: |
# $stack setup --install-ghc
# Use preinstalled stack and ghc. This risks breaking when github updates these,
# but saves a lot of wasteful carbon emissions. As of 2024-04 they are 3.5.1 and 9.12.2.
- name: Install haskell deps
env:
stack: ${{ matrix.plan.stack }}
run: |
$stack build --test --bench --only-dependencies
# --no-terminal
- name: Build all shelltestrunner modules warning free, optimised and minimised, and run any unit/doc/bench tests
env:
stack: ${{ matrix.plan.stack }}
run: |
$stack install --test --bench --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --ghc-options=-split-sections --no-terminal
- name: Run functional tests (excluding windows tests)
env:
stack: ${{ matrix.plan.stack }}
run: |
export PATH=~/.local/bin:$PATH
make STACK="$stack" test