generated from Tiphereth-A/TINplate
-
Notifications
You must be signed in to change notification settings - Fork 4
271 lines (246 loc) · 7.81 KB
/
verify.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: verify
on:
push:
branches:
- master
paths:
- '.github/**'
- '.verify-helper/**'
- 'src/code/**'
- 'src/doc_md/**'
- 'src/test_cpverifier/**'
pull_request:
branches:
- master
paths:
- '.github/**'
- '.verify-helper/**'
- 'src/code/**'
- 'src/doc_md/**'
- 'src/test_cpverifier/**'
workflow_dispatch:
inputs:
ignore_prev_result:
type: boolean
default: false
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.head_ref || 'x' }}-${{ github.workflow }}-${{ github.ref }}-verify
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up competitive-verifier
uses: competitive-verifier/actions/setup@v2
with:
cache-pip: true
- name: oj-resolve
uses: competitive-verifier/actions/oj-resolve@v2
with:
output-path: verify_files.json
include: |
src/code/
src/doc_md/
src/test_cpverifier/
src/test_cpverifier_huge/
exclude: |
libs/
.github/
src/tinplate/
config: .verify-helper/config.toml
- name: parse-doxygen
uses: competitive-verifier/actions/parse-doxygen@v2
with:
verify-files: verify_files.json
- name: Upload verify_files.json
uses: competitive-verifier/actions/upload-verify-artifact@v2
with:
file: verify_files.json
artifact-name: ${{ runner.os }}-verify-files-json
- name: Check bundled
id: test-bundled
run: |
echo "count=$(find .competitive-verifier/bundled/ -type f | wc -l)" >> $GITHUB_OUTPUT
- name: Upload bundled
uses: actions/upload-artifact@v4
if: steps.test-bundled.outputs.count > 0
with:
name: Bundled-${{ runner.os }}
path: .competitive-verifier/bundled
retention-days: 1
verify:
runs-on: ubuntu-latest
needs: [setup]
env:
SPLIT_SIZE: 16
strategy:
max-parallel: 16
matrix:
# prettier-ignore
index:
["00", "01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12", "13", "14", "15"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2147483647
- name: Restore cached results
if: ${{ !inputs.ignore_prev_result }}
uses: actions/cache/restore@v4
id: restore-cached-results
with:
path: ${{github.workspace}}/merged-result.json
key: ${{ runner.os }}-verify-result-${{ github.sha }}
restore-keys: |
${{ runner.os }}-verify-result-
- name: Download verify_files.json
uses: competitive-verifier/actions/download-verify-artifact@v2
with:
artifact-name: ${{ runner.os }}-verify-files-json
- name: Set up competitive-verifier
uses: competitive-verifier/actions/setup@v2
with:
cache-pip: true
- name: Get storage information
run: |
echo "::group::free"
free
echo "::endgroup::"
echo "::group::swapon"
swapon
echo "::endgroup::"
echo "::group::df"
df -ha --o --total
echo "::endgroup::"
echo "::group::du"
du -ha | sort -hr
echo "::endgroup::"
- name: Clean up
run: |
rm -rf fonts
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- name: Get storage information after cleaning up
run: |
echo "::group::free"
free
echo "::endgroup::"
echo "::group::swapon"
swapon
echo "::endgroup::"
echo "::group::df"
df -ha --o --total
echo "::endgroup::"
echo "::group::du"
du -ha | sort -hr
echo "::endgroup::"
- name: Verify
uses: competitive-verifier/actions/verify@v2
with:
destination: ${{runner.temp}}/result.json
split-size: ${{ env.SPLIT_SIZE }}
split-index: ${{ matrix.index }}
timeout: 1800
prev-result: ${{ steps.restore-cached-results.outputs.cache-hit && 'merged-result.json' || ''}}
env:
YUKICODER_TOKEN: ${{secrets.YUKICODER_TOKEN}}
- name: Get storage information after verify
run: |
echo "::group::free"
free
echo "::endgroup::"
echo "::group::swapon"
swapon
echo "::endgroup::"
echo "::group::df"
df -ha --o --total
echo "::endgroup::"
echo "::group::du"
du -ha | sort -hr
echo "::endgroup::"
- name: Upload result artifact
uses: actions/upload-artifact@v4
with:
name: Result-${{ runner.os }}-${{ matrix.index }}
path: ${{runner.temp}}/result.json
retention-days: 1
docs-and-check:
runs-on: ubuntu-latest
needs: [verify]
outputs:
upload-pages: ${{ steps.upload-pages.outcome == 'success' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2147483647
- name: Download verify_files.json and all artifacts
id: all-artifacts
uses: competitive-verifier/actions/download-verify-artifact@v2
with:
download-all: true
artifact-root: .artifacts/
- name: Extract bundled
shell: bash
run: |
rm -rf .competitive-verifier/bundled
if test -d "$SRCDIR"; then
mkdir -p .competitive-verifier/
mv "$SRCDIR" .competitive-verifier/bundled
else
echo "$SRCDIR does not exist."
fi
env:
SRCDIR: .artifacts/Bundled-${{ runner.os }}
- name: Set up competitive-verifier
uses: competitive-verifier/actions/setup@v2
with:
cache-pip: true
- name: Merge results
uses: competitive-verifier/actions/merge-result@v2
with:
result-files: ${{ steps.all-artifacts.outputs.artifacts-root }}/Result-*/result.json
output-path: ${{github.workspace}}/merged-result.json
- name: Docs
uses: competitive-verifier/actions/docs@v2
with:
verify-result: ${{github.workspace}}/merged-result.json
destination: _jekyll
write-summary: true
- name: Save result
if: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) }}
uses: actions/cache/save@v4
with:
path: ${{github.workspace}}/merged-result.json
key: ${{ runner.os }}-verify-result-${{ github.sha }}
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: _jekyll
destination: _site
- name: Upload artifact
id: upload-pages
uses: actions/upload-pages-artifact@v3
with:
path: _site
- name: Check
uses: competitive-verifier/actions/check@v2
with:
verify-result: ${{ steps.all-artifacts.outputs.artifacts-root }}/Result-*/result.json
deploy:
if: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && (success() || failure()) && github.ref == 'refs/heads/master' && needs.docs-and-check.outputs.upload-pages == 'true' }}
needs: docs-and-check
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4