-
-
Notifications
You must be signed in to change notification settings - Fork 63
274 lines (250 loc) · 10.1 KB
/
branch.yml
File metadata and controls
274 lines (250 loc) · 10.1 KB
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
name: Win/Mac/Linux Test
on:
push:
branches-ignore:
- gh-pages
- master
env:
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}/toolchain/clibs.8xg
AUTOTESTER_ROM: ${{github.workspace}}/secrets/83pce_515_530.rom
CEDEV: ${{github.workspace}}/CEdev
CEDEV_BIN: ${{github.workspace}}/CEdev/bin
CEDEV_BINUTILS_BIN: ${{github.workspace}}/CEdev/binutils/bin
CEDEV_EXAMPLES: ${{github.workspace}}/CEdev/examples
CEDEV_TEST: ${{github.workspace}}/toolchain/test
CEMU_PATH: ${{github.workspace}}/CEmu
FASMG_DOMAIN: https://flatassembler.net
FASMG_PATH: ${{github.workspace}}/fasmg
SECRETS_PATH: ${{github.workspace}}/secrets
TOOLCHAIN_PATH: ${{github.workspace}}/toolchain
jobs:
build-and-test:
environment: Autotester
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-22.04, macos-15-intel, macos-14, windows-latest]
compressed: [YES, NO]
include:
- nul: /dev/null
- runs-on: macos-15-intel
fasmg: /source/macos/x64/fasmg
arch-suffix: "-intel"
llvm-project: ez80-clang-link_macOS_intel_nightly.zip
binutils-gdb: binutils_macos_intel_nightly.tar.gz
- runs-on: macos-14
fasmg: /source/macos/x64/fasmg
arch-suffix: "-arm"
llvm-project: ez80-clang-link_macOS_arm_nightly.zip
binutils-gdb: binutils_macos_arm_nightly.tar.gz
- runs-on: windows-latest
fasmg: /fasmg.exe
llvm-project: ez80-clang-link_windows_nightly.zip
binutils-gdb: binutils_windows_nightly.zip
env: "env:"
exe: .exe
nul: nul
ldflags: LDFLAGS="-static-libgcc -static-libstdc++ -static"
- runs-on: ubuntu-22.04
llvm-project: ez80-clang-link_ubuntu_nightly.zip
binutils-gdb: binutils_ubuntu_nightly.tar.gz
fasmg: /fasmg.x64
runs-on: ${{matrix.runs-on}}
steps:
- name: Prepare Build Environment
run: |
cmake -E echo >> $${{matrix.env}}GITHUB_PATH ${{env.CEDEV_BIN}}
cmake -E echo >> $${{matrix.env}}GITHUB_PATH ${{env.CEDEV_BINUTILS_BIN}}
cmake -E make_directory "${{env.CEDEV}}"
cmake -E make_directory "${{env.CEDEV_BIN}}"
- name: Download ez80-clang and ez80-link
id: ez80-bins
uses: carlosperate/download-file-action@v2.0.2
with:
file-url: https://github.com/CE-Programming/llvm-project/releases/download/nightly/${{matrix.llvm-project}}
- name: Extract ez80-clang (Unix)
if: runner.os != 'Windows'
run: unzip -q "${{steps.ez80-bins.outputs.file-path}}" -d "${{env.CEDEV_BIN}}"
- name: Extract ez80-clang (Windows)
if: runner.os == 'Windows'
run: Expand-Archive -Path "${{steps.ez80-bins.outputs.file-path}}" -DestinationPath "${{env.CEDEV_BIN}}"
shell: pwsh
- name: Download binutils
id: binutils
uses: carlosperate/download-file-action@v2.0.2
with:
file-url: https://github.com/CE-Programming/binutils-gdb/releases/download/nightly/${{matrix.binutils-gdb}}
- name: Extract binutils (Unix)
if: runner.os != 'Windows'
run: tar -xzf "${{steps.binutils.outputs.file-path}}" -C "${{env.CEDEV}}"
- name: Extract binutils (Windows)
if: runner.os == 'Windows'
run: Expand-Archive -Path "${{steps.binutils.outputs.file-path}}" -DestinationPath "${{env.CEDEV}}"
shell: pwsh
- name: Add fasmg website to /etc/hosts since DNS seems to be broken
if: runner.os == 'macOS'
run: |
sudo echo "208.99.203.253 flatassembler.net" | sudo tee -a /etc/hosts
- name: Download Fasmg Download Page
id: fasmg-download
uses: carlosperate/download-file-action@v2.0.2
with:
file-url: ${{env.FASMG_DOMAIN}}/download.php
- name: Parse Fasmg Download Page
id: fasmg-url
uses: QwerMike/xpath-action@v1
with:
filename: ${{steps.fasmg-download.outputs.file-path}}
expression: //a[starts-with(text(),"flat assembler g ")]/@href
- name: Extract Fasmg Url
run: cmake -E echo >> $${{matrix.env}}GITHUB_ENV ${{steps.fasmg-url.outputs.result}}
- name: Download Fasmg
id: fasmg
uses: carlosperate/download-file-action@v2.0.2
with:
file-url: ${{env.FASMG_DOMAIN}}/${{env.href}}
- name: Extract Fasmg
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: ${{steps.fasmg.outputs.file-path}}
pathTarget: ${{env.FASMG_PATH}}
- name: Setup Fasmg
run: cmake -E copy fasmg${{matrix.fasmg}} ${{env.CEDEV_BIN}}/fasmg${{matrix.exe}}
- name: Checkout CEmu
uses: actions/checkout@v4
with:
repository: CE-Programming/CEmu
ref: latest-stable
path: ${{env.CEMU_PATH}}
persist-credentials: false
- name: Build CEmu
run: make -j4 -C ${{env.CEMU_PATH}}/core
- name: Build Autotester CLI
run: make -j4 -C ${{env.CEMU_PATH}}/tests/autotester ${{matrix.ldflags}}
- name: Install Autotester CLI
run: cmake -E copy ${{env.CEMU_PATH}}/tests/autotester/autotester${{matrix.exe}} ${{env.CEDEV_BIN}}/cemu-autotester${{matrix.exe}}
- name: Make Binaries Executable
if: runner.os != 'Windows'
run: |
chmod +x ${{env.CEDEV_BIN}}/*
chmod +x ${{env.CEDEV_BINUTILS_BIN}}/*
- name: Test Build Dependencies
run: |
ez80-clang --version
ez80-link --version
fasmg ${{matrix.nul}} ${{matrix.nul}}
- name: Checkout Toolchain
uses: actions/checkout@v4
with:
path: ${{env.TOOLCHAIN_PATH}}
submodules: recursive
persist-credentials: false
- name: Build Toolchain
run: make -j4 -C ${{env.TOOLCHAIN_PATH}} V=1
- name: Build Libraries
run: |
make -j4 -C ${{env.TOOLCHAIN_PATH}} libs V=1
make -j4 -C ${{env.TOOLCHAIN_PATH}} libs-zip V=1
- name: Install Toolchain
env:
PREFIX: ${{github.workspace}}
run: make -j4 -C ${{env.TOOLCHAIN_PATH}} install V=1 DESTDIR=${{github.workspace}}
- name: Remove Fasmg
run: cmake -E rm -f ${{env.CEDEV_BIN}}/fasmg${{matrix.exe}}
- name: Make Binaries Executable
if: runner.os != 'Windows'
run: |
chmod +x ${{env.CEDEV_BIN}}/*
chmod +x ${{env.CEDEV_BINUTILS_BIN}}/*
- name: Build Test Graphics
run: make -j4 -C ${{env.CEDEV_TEST}} COMPRESSED=${{matrix.compressed}} V=1 gfx
- name: Build Tests
run: make -j4 -C ${{env.CEDEV_TEST}} COMPRESSED=${{matrix.compressed}} V=1
- name: Upload Test Build Artifacts
uses: actions/upload-artifact@v4
if: "contains(github.event.head_commit.message, 'upload')"
with:
name: tests-${{runner.os}}${{matrix.arch-suffix}}-${{matrix.compressed}}
path: ${{env.CEDEV_TEST}}
- name: Build Example Graphics
run: make -j4 -C ${{env.CEDEV_EXAMPLES}} COMPRESSED=${{matrix.compressed}} V=1 gfx
- name: Build Examples
run: make -j4 -C ${{env.CEDEV_EXAMPLES}} COMPRESSED=${{matrix.compressed}} V=1
- name: Upload Example Build Artifacts
uses: actions/upload-artifact@v4
if: "contains(github.event.head_commit.message, 'upload')"
with:
name: examples-${{runner.os}}${{matrix.arch-suffix}}-${{matrix.compressed}}
path: ${{env.CEDEV_EXAMPLES}}
- name: Download CI test secrets
uses: actions/checkout@v4
with:
repository: "CE-Programming/ci-test-secrets"
token: ${{ secrets.GH_PAT_CI_SECRETS }}
path: "secrets"
- name: Test Examples
if: runner.os != 'Windows'
run: |
find ${{env.CEDEV_EXAMPLES}} -name autotest.json -print0 | {
failed=0
while read -d '' test; do
make -C $(dirname $test) test || cmake -E true $((failed += $?))
done
cmake -E echo "$failed tests failed"
exit $failed
}
- name: Test Examples
if: runner.os == 'Windows'
run: |
$failed = 0
foreach ($test in get-childitem "${{env.CEDEV_EXAMPLES}}" -recurse -include autotest.json) {
make -C (split-path -path $test) test
$failed += $lastexitcode
}
cmake -E echo "$failed tests failed"
exit $failed
- name: Test Tests
if: runner.os != 'Windows'
run: |
find ${{env.CEDEV_TEST}} -name autotest.json -print0 | {
failed=0
while read -d '' test; do
make -C $(dirname $test) test || cmake -E true $((failed += $?))
done
cmake -E echo "$failed tests failed"
exit $failed
}
- name: Test Tests
if: runner.os == 'Windows'
run: |
$failed = 0
foreach ($test in get-childitem "${{env.CEDEV_TEST}}" -recurse -include autotest.json) {
make -C (split-path -path $test) test
$failed += $lastexitcode
}
cmake -E echo "$failed tests failed"
exit $failed
- name: Remove Secrets
if: always()
run: cmake -E rm -rf ${{env.SECRETS_PATH}}
docs:
runs-on: ubuntu-latest
steps:
- name: Install Documentation Dependencies
run: |
sudo apt-get install -y doxygen
cmake -E echo >> $${{matrix.env}}GITHUB_PATH $${{matrix.env}}HOME/.local/bin
- name: Checkout Toolchain
uses: actions/checkout@v4
with:
path: ${{env.TOOLCHAIN_PATH}}
persist-credentials: false
fetch-depth: 0
- name: Install Sphinx Dependencies
run: pip install -r ${{env.TOOLCHAIN_PATH}}/docs/requirements.txt
- name: Build Website Documentation
run: make -C ${{env.TOOLCHAIN_PATH}} docs
- name: Disable Jekyll
run: touch ${{env.TOOLCHAIN_PATH}}/docs/build/html/.nojekyll
- name: Remove .pickle files
run: find ${{env.TOOLCHAIN_PATH}}/docs/build/ -name '*.pickle' -delete