-
-
Notifications
You must be signed in to change notification settings - Fork 322
156 lines (124 loc) · 5.24 KB
/
oldest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# 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
env:
# This workflow uses github's preinstalled ghc & stack on ubuntu.
# Keep these synced with the latest ghc version at https://github.com/actions/runner-images/blob/ubuntu22/20240514.2/images/ubuntu/Ubuntu2404-Readme.md#haskell-tools
#
# caching id for this ghc's build artifacts:
# XXX supposed to be interpolated by $ghc below, but this is not working
ghc: 8107
# stack config for this ghc:
stack: stack --stack-yaml=stack8.10.yaml
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 }}-stack-global-$ghc-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-$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-$ghc-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs-$ghc
- name: Cache - .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-$ghc-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work-$ghc
- name: Cache - hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-$ghc-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-lib-stack-work-$ghc
- name: Cache - hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-$ghc-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-stack-work-$ghc
- name: Cache - hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-$ghc-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-ui-stack-work-$ghc
- name: Cache - hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-$ghc-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-web-stack-work-$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