-
Notifications
You must be signed in to change notification settings - Fork 55
279 lines (273 loc) · 9.14 KB
/
validate-and-report.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
272
273
274
275
276
277
278
279
name: Build PSX and PSP version
on:
push:
branches:
- master
paths-ignore:
- '*.md'
- '**/*.md'
pull_request:
paths-ignore:
- '*.md'
- '**/*.md'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.job }}-${{ github.event_name }}-${{ github.number }}
cancel-in-progress: false
jobs:
build-and-test:
strategy:
matrix:
version: ["us", "hd", "pspeu"]
include:
- dependency: us
version: us
- dependency: pspeu
version: hd
- dependency: pspeu
version: pspeu
# Building and testing cannot work if the repository owner is not Xeeynamo
# due to the missing secrets to clone the CI dependencies
if: github.repository == 'Xeeynamo/sotn-decomp'
runs-on: ubuntu-latest
env:
VERSION: ${{ matrix.version }}
steps:
- name: Install requirements
run: sudo apt-get install gcc-mipsel-linux-gnu
- name: Clone main repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: false
- name: Install tools requirements
run: make update-dependencies
- name: Get dependencies
uses: actions/cache@v4
id: get-dependencies
with:
path: 'disks/dependencies'
key: sotn-${{ matrix.dependency }}-deps
- name: Get dependencies (uncached)
if: steps.get-dependencies.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: xeeynamo/sotn-decomp-dependencies
ref: ${{ matrix.dependency }}
token: ${{ secrets.SOTN_DECOMP_DEPENDENCIES_TOKEN }}
path: 'disks/dependencies'
- name: Cache dependencies
if: steps.get-dependencies.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: 'disks/dependencies'
key: sotn-${{ matrix.dependency }}-deps
- name: Setting up dependencies
working-directory: disks
run: cat dependencies/* | tar -zxf -
- name: Extract dependencies
run: make extract_disk
- name: Split game data
run: make -j extract
- name: Build binaries
run: make -j build
- name: Check if they match
run: make check
- name: Analyze calls dry run
if: matrix.version == 'us'
run: |
make force_symbols
make force_extract
.venv/bin/python3 ./tools/analyze_calls.py --ultradry
- name: Remove clutter from build folder
run: rm -rf build/${{ matrix.version }}/asm build/${{ matrix.version }}/src build/${{ matrix.version }}/assets
- name: Export build folder
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: build_${{ matrix.version }}
path: build/${{ matrix.version }}
generate-progress-report:
strategy:
matrix:
version: ["us", "hd", "pspeu"]
include:
- dependency: us
version: us
- dependency: pspeu
version: hd
- dependency: pspeu
version: pspeu
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: build-and-test
runs-on: ubuntu-latest
env:
VERSION: ${{ matrix.version }}
FROGRESS_API_BASE_URL: ${{ secrets.FROGRESS_API_BASE_URL }}
FROGRESS_API_SECRET: ${{ secrets.FROGRESS_API_SECRET }}
DISCORD_PROGRESS_WEBHOOK: ${{ secrets.DISCORD_PROGRESS_WEBHOOK }}
steps:
- name: Clone main repository
uses: actions/checkout@v4
with:
submodules: false
- name: Install requirements
run: make update-dependencies
- name: Get dependencies
uses: actions/cache@v4
with:
path: 'disks/dependencies'
key: sotn-${{ matrix.dependency }}-deps
- name: Setting up dependencies
working-directory: disks
run: cat dependencies/* | tar -zxf -
- name: Extract dependencies
run: make extract_disk
- name: Split game data
run: make -j extract
- name: Obtain built binaries
uses: actions/download-artifact@v4
with:
name: build_${{ matrix.version }}
path: build/${{ matrix.version }}
- name: Generate and send progress report
run: .venv/bin/python3 tools/progress.py --version ${{ matrix.version }}
generate-duplicates-report:
strategy:
matrix:
version: ["us"]
include:
- dependency: us
version: us
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: build-and-test
runs-on: ubuntu-latest
env:
VERSION: ${{ matrix.version }}
steps:
- name: Clone main repository
uses: actions/checkout@v4
with:
submodules: false
- name: Install requirements
run: make update-dependencies
- name: Get dependencies
uses: actions/cache@v4
with:
path: 'disks/dependencies'
key: sotn-${{ matrix.dependency }}-deps
- name: Setting up dependencies
working-directory: disks
run: cat dependencies/* | tar -zxf -
- name: Extract dependencies
run: make extract_disk
- name: Obtain built binaries
uses: actions/download-artifact@v4
with:
name: build_${{ matrix.version }}
path: build/${{ matrix.version }}
- name: Clone asset repository
uses: actions/checkout@v4
with:
ref: 'gh-duplicates'
path: 'gh-duplicates'
- name: Set-up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install secondary pre-requirements
run: |
make python-dependencies & \
(sudo apt-get update && sudo apt-get install graphviz) & \
wait
- name: Generate function calls chart
run: |
make force_symbols
make force_extract
.venv/bin/python3 tools/analyze_calls.py
git clean -fdx asm/
- name: Generate function report
run: |
git checkout config/
rm -rf build/us/main.ld
rm -rf build/us/weapon.ld
make -j extract
.venv/bin/python3 tools/function_finder/function_finder_psx.py --use-call-trees > gh-duplicates/functions.md
rm -rf gh-duplicates/function_calls/ || true
mv function_calls gh-duplicates/
mv function_graphs.md gh-duplicates
- name: Generate duplicates report
run: |
make force_symbols
make force_extract
cd tools/dups
cargo run --release -- --threshold .90 --output-file ../../gh-duplicates/duplicates.txt
- name: Commit all reports
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add -A
git commit -m 'Update reports' || true
git push
working-directory: gh-duplicates
generate-duplicates-report-psp:
strategy:
matrix:
version: ["pspeu"]
include:
- dependency: pspeu
version: pspeu
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: build-and-test
runs-on: ubuntu-latest
env:
VERSION: ${{ matrix.version }}
steps:
- name: Clone main repository
uses: actions/checkout@v4
with:
submodules: false
- name: Install requirements
run: make update-dependencies
- name: Get dependencies
uses: actions/cache@v4
with:
path: 'disks/dependencies'
key: sotn-${{ matrix.dependency }}-deps
- name: Setting up dependencies
working-directory: disks
run: cat dependencies/* | tar -zxf -
- name: Extract dependencies
run: make extract_disk
- name: Obtain built binaries
uses: actions/download-artifact@v4
with:
name: build_${{ matrix.version }}
path: build/${{ matrix.version }}
- name: Clone asset repository
uses: actions/checkout@v4
with:
ref: 'gh-duplicates-${{ matrix.version }}'
path: 'gh-duplicates'
- name: Set-up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install secondary pre-requirements
run: |
make python-dependencies &
(sudo apt-get update && sudo apt-get install graphviz) & \
wait
- name: Generate function report
run: |
make clean && make -j extract
find asm -print
.venv/bin/python3 tools/function_finder/function_finder_psp.py > gh-duplicates/functions.md
- name: Commit all reports
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add -A
git commit -m 'Update reports' || true
git push
working-directory: gh-duplicates