System.IO.hGetContents' was the latest paper cut; I could keep supporting ghc 8.10.7, or at least 9.0-9.4, released 2021-2023; but feck it. Debian Stable has 9.6 and this time can be better spent.
154 lines
5.1 KiB
YAML
154 lines
5.1 KiB
YAML
# TRIGGER: Runs on any push to oldest branch.
|
||
# ACTION: Builds and tests with stack and the oldest supported ghc.
|
||
|
||
name: oldest
|
||
|
||
on:
|
||
# When there's a push to the oldest branch, it runs in that branch.
|
||
push:
|
||
branches: [ oldest ]
|
||
# If manually triggered in github ui, it runs in master.
|
||
workflow_dispatch:
|
||
|
||
jobs:
|
||
oldest:
|
||
runs-on: ubuntu-24.04
|
||
# arch: x64
|
||
# image: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
|
||
|
||
env:
|
||
stack: stack --stack-yaml=stack96.yaml
|
||
ghc: 9.6.6
|
||
|
||
steps:
|
||
|
||
- name: Check out
|
||
uses: actions/checkout@v4
|
||
# have to fetch everything for git describe for hledger's --version
|
||
with:
|
||
fetch-depth: 0
|
||
|
||
|
||
# CACHES
|
||
|
||
- name: Cache - stack global package db
|
||
id: stack-global
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: ~/.stack
|
||
# XXX if stack.yaml is a symlink, this fails with
|
||
# Error: The template is not valid. .github/workflows/push.yml (Line: 103, Col: 14): hashFiles('**.yaml') failed.
|
||
# Fail to hash files under directory '/home/runner/work/hledger/hledger'
|
||
key: ${{ runner.os }}-x64-stack-global-${{ env.ghc }}-${{ hashFiles('**.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-x64-stack-global-${{ env.ghc }}
|
||
|
||
- name: Cache - stack-installed programs in ~/.local/bin
|
||
id: stack-programs
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: ~/.local/bin
|
||
key: ${{ runner.os }}-x64-stack-programs-${{ env.ghc }}-${{ hashFiles('**.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-x64-stack-programs-${{ env.ghc }}
|
||
|
||
- name: Cache - .stack-work
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: .stack-work
|
||
key: ${{ runner.os }}-x64-stack-work-${{ env.ghc }}-${{ hashFiles('**.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-x64-stack-work-${{ env.ghc }}
|
||
|
||
- name: Cache - hledger-lib/.stack-work
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: hledger-lib/.stack-work
|
||
key: ${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghc }}-${{ hashFiles('hledger-lib/package.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghc }}
|
||
|
||
- name: Cache - hledger/.stack-work
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: hledger/.stack-work
|
||
key: ${{ runner.os }}-x64-hledger-stack-work-${{ env.ghc }}-${{ hashFiles('hledger/package.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-x64-hledger-stack-work-${{ env.ghc }}
|
||
|
||
- name: Cache - hledger-ui/.stack-work
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: hledger-ui/.stack-work
|
||
key: ${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghc }}-${{ hashFiles('hledger-ui/package.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghc }}
|
||
|
||
- name: Cache - hledger-web/.stack-work
|
||
uses: actions/cache@v4
|
||
with:
|
||
path: hledger-web/.stack-work
|
||
key: ${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghc }}-${{ hashFiles('hledger-web/package.yaml') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghc }}
|
||
|
||
|
||
# ACTIONS
|
||
# in modular steps for faster & more focussed failures
|
||
|
||
- name: Install GHC
|
||
run: |
|
||
$stack setup --install-ghc
|
||
|
||
|
||
- name: Build deps of hledger-lib
|
||
run: |
|
||
$stack build --test --bench hledger-lib --only-dependencies
|
||
|
||
- name: Build/test hledger-lib
|
||
run: |
|
||
$stack install --test --bench hledger-lib --fast --ghc-options=-Werror
|
||
|
||
|
||
- name: Build deps of hledger
|
||
run: |
|
||
$stack build --test --bench hledger --only-dependencies
|
||
|
||
- name: Build/test hledger
|
||
run: |
|
||
$stack install --test --bench hledger --fast --ghc-options=-Werror
|
||
|
||
|
||
- name: Build deps of hledger-ui
|
||
run: |
|
||
$stack build --test --bench hledger-ui --only-dependencies
|
||
|
||
- name: Build/test hledger-ui
|
||
run: |
|
||
$stack install --test --bench hledger-ui --fast --ghc-options=-Werror
|
||
|
||
|
||
- name: Build deps of hledger-web
|
||
run: |
|
||
$stack build --test --bench hledger-web --only-dependencies
|
||
|
||
- name: Build/test hledger-web
|
||
run: |
|
||
$stack install --test --bench hledger-web --fast --ghc-options=-Werror
|
||
|
||
# XXX disable until this is fixed: shelltestrunner-1.10/src/shelltest.hs:125:20: error:
|
||
# shelltestrunner > Not in scope: ‘configFailFast’
|
||
# shelltestrunner > Perhaps you meant ‘configFastFail’ (imported from Test.Hspec.Core.Runner)
|
||
|
||
# - name: Install shelltestrunner
|
||
# run: |
|
||
# export PATH=~/.local/bin:$PATH
|
||
# if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install shelltestrunner-1.10; fi
|
||
# shelltest --version
|
||
|
||
# - name: Test functional tests (excluding addons)
|
||
# run: |
|
||
# export PATH=~/.local/bin:$PATH
|
||
# COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected
|
||
# # XXX run the bin/ func tests corresponding to the GHC version enabled above, only
|