-
-
Notifications
You must be signed in to change notification settings - Fork 9
197 lines (197 loc) · 6.51 KB
/
haskell.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# Code generated by dhall-to-yaml. DO NOT EDIT.
jobs:
build:
container: "ghcr.io/konn/computational-algebra/gha:0.7"
"continue-on-error": "${{matrix.isHead}}"
env:
STACK_YAML: "stack-${{matrix.ghc}}.yaml"
name: "Build ${{matrix.ghc}}"
"runs-on": "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- name: Cache ~/.stack
uses: "actions/cache@v2"
with:
key: "${{runner.os}}-build-global-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-${{ hashFiles(format('{0}', env.STACK_YAML)) }}"
path: ~/.stack
"restore-keys": |
${{runner.os}}-build-global-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-
${{runner.os}}-build-global-stack-${{matrix.ghc}}-
- name: "Cache **/.stack-work"
uses: "actions/cache@v2"
with:
key: "${{runner.os}}-build-local-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-${{ hashFiles(format('{0}', env.STACK_YAML)) }}-${{ hashFiles('**/*.hs','**/*.lhs') }}"
path: "**/.stack-work"
"restore-keys": |
${{runner.os}}-build-local-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-${{ hashFiles(format('{0}', env.STACK_YAML)) }}-
${{runner.os}}-build-local-stack-${{matrix.ghc}}-${{ hashFiles('**/package.yaml','**/*.cabal') }}-
${{runner.os}}-build-local-stack-${{matrix.ghc}}-
- name: Build
run: "stack build --test --no-run-tests --haddock --no-haddock-deps"
- name: Collect docs
run: "cp -r $(stack path --local-doc-root) docs/"
- name: Collect test exes
run: |
mkdir -p "test-bins/"
stack ide targets 2>&1 | grep :test: | while read i; do
PACK=$(echo "$i" | cut -d':' -f1);
EXE=$(echo "$i" | cut -d':' -f3);
cp "${PACK}/$(stack path --dist-dir)/build/${EXE}/${EXE}" "test-bins/";
done
- name: "Upload test-artifacts-${{ matrix.ghc }}"
uses: "actions/[email protected]"
with:
name: "test-artifacts-${{ matrix.ghc }}"
path: "test-bins/"
- name: "Upload doc-artifacts-${{matrix.ghc}}"
uses: "actions/[email protected]"
with:
name: "doc-artifacts-${{matrix.ghc}}"
path: docs/
strategy:
"fail-fast": false
matrix:
ghc:
- '8.10.7'
- '9.0.2'
include:
- ghc: '9.2.2'
isHead: true
isHead:
- false
"build-pages":
"continue-on-error": "${{matrix.isHead}}"
env: {}
name: "Build GitHub Pages for ${{matrix.ghc}}"
needs:
- build
- "build-site-generator"
"runs-on": "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
with:
ref: "gh-pages-devel"
- name: Cache _cache
uses: "actions/cache@v2"
with:
key: "${{runner.os}}-site-${{matrix.ghc}}-${{ hashFiles('index.md','stylesheets/**/*','templates/**/*','katex/**/*','javascripts/**/*','images/**/*') }}"
path: _cache
"restore-keys": "${{runner.os}}-site-${{matrix.ghc}}-"
- name: "Installs dependency (node)"
run: npm install jsdom
- id: docs
uses: "actions/download-artifact@v2"
with:
name: "doc-artifacts-${{matrix.ghc}}"
path: docs/
- name: Place document in correct place
run: |
if [ "${{steps.docs.outputs.download-path}}" != "$(pwd)/docs" ]; then
cp -r ${{steps.docs.outputs.download-path}} ./docs;
fi
- id: "site-bin"
name: Download site generator
uses: "actions/download-artifact@v2"
with:
name: "site-bin-artifact"
path: "site-bin"
- name: Locate bin
run: |
cp -r ${{steps.site-bin.outputs.download-path}}/site ./
chmod +x ./site
- name: Generate static site
run: ./site build
- name: "Upload pages-artifacts-${{matrix.ghc}}"
uses: "actions/[email protected]"
with:
name: "pages-artifacts-${{matrix.ghc}}"
path: _site/
strategy:
"fail-fast": false
matrix:
ghc:
- '8.10.7'
include: []
isHead:
- false
"build-site-generator":
name: Build Site Generator
"runs-on": "ubuntu-20.04"
steps:
- uses: "actions/checkout@v2"
with:
ref: "gh-pages-devel"
- name: Cache ~/.stack
uses: "actions/cache@v2"
with:
key: "document-global-stack-${{ hashFiles('package.yaml','**/*.cabal','stack.yaml') }}"
path: ~/.stack
"restore-keys": "document-global-stack-"
- name: "Cache **/.stack-work"
uses: "actions/cache@v2"
with:
key: "document-local-stack-${{ hashFiles('package.yaml','**/*.cabal','stack.yaml') }}-${{ hashFiles('**/*.hs') }}"
path: "**/.stack-work"
"restore-keys": |
document-local-stack-${{ hashFiles('package.yaml','**/*.cabal','stack.yaml') }}-
document-local-stack-
- uses: "haskell/actions/setup@v1"
with:
"enable-stack": 'true'
"ghc-version": '8.10.7'
"stack-version": '2.7.3'
- name: Build static site generator
run: "stack build --fast"
- name: Collect bins
run: |
mkdir -p "site-bin"
cp "$(stack path --dist-dir)/build/site/site" "site-bin"
- name: "Upload site-bin-artifact"
uses: "actions/[email protected]"
with:
name: "site-bin-artifact"
path: "site-bin"
test:
container: "ghcr.io/konn/computational-algebra/gha:0.7"
"continue-on-error": "${{matrix.isHead}}"
env:
STACK_YAML: "stack-${{matrix.ghc}}.yaml"
name: "Test ${{matrix.ghc}}"
needs:
- build
"runs-on": "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- id: "test-bins"
uses: "actions/download-artifact@v2"
with:
name: "test-artifacts-${{ matrix.ghc }}"
path: "test-bins/"
- name: Run all tests
run: |
ls "${{steps.test-bins.outputs.download-path}}"
stack ide targets 2>&1 | grep :test: | while read i; do
TEST_EXE=$(echo "$i" | cut -d':' -f3)
echo "Testing: ${TEST_EXE}"
chmod +x "${{steps.test-bins.outputs.download-path}}/${TEST_EXE}"
"${{steps.test-bins.outputs.download-path}}/${TEST_EXE}" +RTS -N
done
strategy:
"fail-fast": false
matrix:
ghc:
- '8.10.7'
- '9.0.2'
include:
- ghc: '9.2.2'
isHead: true
isHead:
- false
name: Build
'on':
pull_request: {}
push:
branches:
- master
schedule:
- cron: "00 13 * * *"