Skip to content

Commit 542e1f0

Browse files
committed
Cleanup actions workflow.
1 parent 05479a1 commit 542e1f0

File tree

1 file changed

+87
-86
lines changed

1 file changed

+87
-86
lines changed

.github/workflows/make.yml

Lines changed: 87 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -8,239 +8,240 @@ on:
88
branches:
99
- master
1010

11+
env:
12+
CEMU_PATH: ${{github.workspace}}/CEmu
13+
FASMG_DOMAIN: https://flatassembler.net
14+
HOST_DOMAIN: https://jacobly.com
15+
INSTALL_PATH: ${{github.workspace}}/CEdev
16+
ROM_FILE: 84pce_515_53.rom
17+
SECRETS_PATH: ${{github.workspace}}/secrets
18+
TOOLCHAIN_PATH: ${{github.workspace}}/toolchain
1119
jobs:
1220
build:
1321
strategy:
1422
fail-fast: false
1523
matrix:
16-
runs-on: [ubuntu-latest, macos-latest, windows-latest]
17-
runs-on: ${{matrix.runs-on}}
24+
runs-on: [ubuntu, macos, windows]
25+
include:
26+
- nul: /dev/null
27+
- runs-on: macos
28+
fasmg: /source/macos/x64
29+
- runs-on: windows
30+
env: "env:"
31+
exe: .exe
32+
nul: nul
33+
runs-on: ${{matrix.runs-on}}-latest
1834
steps:
19-
- name: Bootstrap Build Environment
20-
if: runner.os == 'Windows'
21-
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
22-
- name: Prepare Build Environment
23-
run: cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEdev/bin
24-
- name: Prepare Build Environment
25-
if: runner.os == 'macOS'
26-
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV FASMG_PATH=/source/macos/x64
2735
- name: Prepare Build Environment
28-
if: runner.os != 'Windows'
29-
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV NUL=/dev/null
30-
- name: Prepare Build Environment
31-
if: runner.os == 'Windows'
32-
run: |
33-
cmake -E echo >> $${{env.ENV}}GITHUB_ENV NUL=nul
34-
cmake -E echo >> $${{env.ENV}}GITHUB_ENV EXE=.exe
36+
run: cmake -E echo >> $${{matrix.env}}GITHUB_PATH ${{env.INSTALL_PATH}}/bin
3537

3638
- name: Download ez80-clang
3739
id: ez80-clang
3840
uses: carlosperate/download-file-action@v1.0.3
3941
with:
40-
file-url: https://jacobly.com/a/llvm/ez80-clang${{env.EXE}}-${{runner.os}}Release.zip
42+
file-url: ${{env.HOST_DOMAIN}}/a/llvm/ez80-clang${{matrix.exe}}-${{runner.os}}Release.zip
4143
- name: Extract ez80-clang
4244
uses: DuckSoft/extract-7z-action@v1.0
4345
with:
4446
pathSource: ${{steps.ez80-clang.outputs.file-path}}
45-
pathTarget: CEdev/bin
47+
pathTarget: ${{env.INSTALL_PATH}}/bin
4648

4749
- name: Download Fasmg Download Page
48-
id: flatassembler-download
50+
id: fasmg-download
4951
uses: carlosperate/download-file-action@v1.0.3
5052
with:
51-
file-url: https://flatassembler.net/download.php
53+
file-url: ${{env.FASMG_DOMAIN}}/download.php
5254
- name: Parse Fasmg Download Page
5355
id: fasmg-url
5456
uses: QwerMike/xpath-action@v1
5557
with:
56-
filename: ${{steps.flatassembler-download.outputs.file-path}}
58+
filename: ${{steps.fasmg-download.outputs.file-path}}
5759
expression: //a[starts-with(text(),"flat assembler g ")]/@href
5860
- name: Extract Fasmg Url
59-
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV ${{steps.fasmg-url.outputs.result}}
61+
run: cmake -E echo >> $${{matrix.env}}GITHUB_ENV ${{steps.fasmg-url.outputs.result}}
6062
- name: Download Fasmg
6163
id: fasmg
6264
uses: carlosperate/download-file-action@v1.0.3
6365
with:
64-
file-url: https://flatassembler.net/${{env.href}}
66+
file-url: ${{env.FASMG_DOMAIN}}/${{env.href}}
6567
- name: Extract Fasmg
6668
uses: DuckSoft/extract-7z-action@v1.0
6769
with:
6870
pathSource: ${{steps.fasmg.outputs.file-path}}
69-
pathTarget: fasmg
71+
pathTarget: ${{github.workspace}}/fasmg
7072
- name: Setup Fasmg
71-
run: cmake -E copy fasmg${{env.FASMG_PATH}}/fasmg${{env.EXE}} CEdev/bin
73+
run: cmake -E copy fasmg${{matrix.fasmg}}/fasmg${{matrix.exe}} ${{env.INSTALL_PATH}}/bin
7274

7375
- name: Make Binaries Executable
7476
if: runner.os != 'Windows'
75-
run: chmod +x CEdev/bin/*
77+
run: chmod +x ${{env.INSTALL_PATH}}/bin/*
7678
- name: Test Build Dependencies
7779
run: |
7880
ez80-clang --version
79-
fasmg ${{env.NUL}} ${{env.NUL}}
81+
fasmg ${{matrix.nul}} ${{matrix.nul}}
8082
8183
- name: Checkout Toolchain
8284
uses: actions/checkout@v2.3.4
8385
with:
84-
path: toolchain
86+
path: ${{env.TOOLCHAIN_PATH}}
8587
submodules: recursive
88+
persist-credentials: false
8689
- name: Build Toolchain
87-
run: make -j4 -C toolchain V=1
90+
run: make -j4 -C ${{env.TOOLCHAIN_PATH}} V=1
8891
- name: Install Toolchain
8992
env:
9093
PREFIX: ${{github.workspace}}
91-
run: make -j4 -C toolchain install release release-libs V=1
94+
run: make -j4 -C ${{env.TOOLCHAIN_PATH}} install release release-libs V=1
9295

9396
- name: Upload CEdev
9497
uses: actions/upload-artifact@v2
9598
with:
9699
name: CEdev-${{runner.os}}
97-
path: CEdev
100+
path: ${{env.INSTALL_PATH}}
98101
- name: Upload Libraries
99102
uses: actions/upload-artifact@v2
100103
with:
101104
name: clibs
102-
path: toolchain/clibs.8xg
105+
path: ${{env.TOOLCHAIN_PATH}}/clibs.8xg
103106
- name: Upload Windows Installer
104107
if: runner.os == 'Windows'
105108
uses: actions/upload-artifact@v2
106109
with:
107110
name: installer-${{runner.os}}
108-
path: toolchain\release\CEdev${{env.EXE}}
111+
path: ${{env.TOOLCHAIN_PATH}}/release/CEdev${{matrix.exe}}
109112

110113
test:
111114
needs: build
112-
if: github.event_name != 'pull_request'
115+
environment: Autotester
113116
strategy:
114117
fail-fast: false
115118
matrix:
116-
runs-on: [ubuntu-latest, macos-latest, windows-latest]
117-
installer: [CEdev]
118-
include:
119-
- runs-on: windows-latest
119+
runs-on: [ubuntu, macos, windows]
120+
installer: [CEdev, installer]
121+
exclude:
122+
- runs-on: ubuntu
120123
installer: installer
121-
runs-on: ${{matrix.runs-on}}
124+
- runs-on: macos
125+
installer: installer
126+
include:
127+
- runs-on: windows
128+
env: "env:"
129+
runs-on: ${{matrix.runs-on}}-latest
122130
steps:
123-
- name: Bootstrap Test Environment
124-
if: runner.os == 'Windows'
125-
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
126131
- name: Prepare Test Environment
127132
run: |
128-
cmake -E echo >> $${{env.ENV}}GITHUB_ENV ROM=84pce_515_53.rom
129-
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CEDEV=${{github.workspace}}/CEdev
130-
cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEdev/bin
131-
cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEmu/tests/autotester
133+
cmake -E echo >> $${{matrix.env}}GITHUB_ENV CEDEV=${{env.INSTALL_PATH}}
134+
cmake -E echo >> $${{matrix.env}}GITHUB_PATH ${{env.INSTALL_PATH}}/bin
135+
cmake -E echo >> $${{matrix.env}}GITHUB_PATH ${{env.CEMU_PATH}}/tests/autotester
132136
133137
- name: Download CEdev
134138
uses: actions/download-artifact@v2
135139
with:
136140
name: ${{matrix.installer}}-${{runner.os}}
137-
path: ${{env.CEDEV}}
141+
path: ${{env.INSTALL_PATH}}
138142
- name: Install CEdev
139143
if: matrix.installer == 'installer'
140-
run: ${{env.CEDEV}}/CEDev${{env.EXE}} /DIR=${{env.CEDEV}} /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
141-
142-
- name: Download Libraries
143-
uses: actions/download-artifact@v2
144-
with:
145-
name: clibs
144+
run: ${{env.INSTALL_PATH}}/CEdev.exe /DIR=${{env.INSTALL_PATH}} /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
146145

147146
- name: Make Binaries Executable
148147
if: runner.os != 'Windows'
149-
run: chmod +x ${{env.CEDEV}}/bin/*
148+
run: chmod +x ${{env.INSTALL_PATH}}/bin/*
150149
- name: Build Examples
151-
run: make -j4 -C ${{env.CEDEV}}/examples V=1
150+
env:
151+
CEDEV: ${{env.INSTALL_PATH}}
152+
run: make -j4 -C ${{env.INSTALL_PATH}}/examples V=1
152153

153154
- name: Checkout CEmu
154155
uses: actions/checkout@v2.3.4
155156
with:
156157
repository: CE-Programming/CEmu
157158
ref: latest-stable
158-
path: CEmu
159+
path: ${{env.CEMU_PATH}}
160+
persist-credentials: false
159161
- name: Build CEmu
160-
run: make -j4 -C CEmu/core
162+
run: make -j4 -C ${{env.CEMU_PATH}}/core
161163
- name: Build Autotester CLI
162-
run: make -j4 -C CEmu/tests/autotester
164+
run: make -j4 -C ${{env.CEMU_PATH}}/tests/autotester
163165

164166
- name: Download Secrets
165167
id: download-secrets
166168
uses: carlosperate/download-file-action@v1.0.3
167169
with:
168-
file-url: https://jacobly.com/CE-Programming/secrets
169-
location: secrets
170+
file-url: ${{env.HOST_DOMAIN}}/CE-Programming/secrets
171+
location: ${{env.SECRETS_PATH}}
170172
- name: Decrypt Secrets
171173
env:
172174
KEY: ${{secrets.SYMMETRIC_KEY_256}}
173-
run: openssl enc -d -aes-256-cbc -iv d0583d991fcb6c3b05fb8eabc7421fb8 -K "$${{env.ENV}}KEY" -in ${{steps.download-secrets.outputs.file-path}} -out secrets/secrets.7z
175+
run: openssl enc -d -aes-256-cbc -iv 8b29a858b29556c72b861a70f26872cb -K "$${{matrix.env}}KEY" -in ${{steps.download-secrets.outputs.file-path}} -out ${{env.SECRETS_PATH}}/secrets.7z
174176
- name: Extract Secrets
175177
uses: DuckSoft/extract-7z-action@v1.0
176178
with:
177-
pathSource: secrets/secrets.7z
178-
pathTarget: secrets
179+
pathSource: ${{env.SECRETS_PATH}}/secrets.7z
180+
pathTarget: ${{env.SECRETS_PATH}}
179181

180-
- name: Test examples
182+
- name: Download Libraries
183+
uses: actions/download-artifact@v2
184+
with:
185+
name: clibs
186+
- name: Test Examples
181187
if: runner.os != 'Windows'
182188
env:
183189
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}/clibs.8xg
184-
AUTOTESTER_ROM: ${{github.workspace}}/secrets/${{env.ROM}}
190+
AUTOTESTER_ROM: ${{env.SECRETS_PATH}}/${{env.ROM_FILE}}
191+
CEDEV: ${{env.INSTALL_PATH}}
185192
run: |
186193
failed=0
187-
find ${{env.CEDEV}}/examples -name autotest.json -print0 | while read -d '' test; do
194+
find ${{env.INSTALL_PATH}}/examples -name autotest.json -print0 | while read -d '' test; do
188195
cmake -E echo "Launching autotester on $test"
189196
autotester "$test"
190197
cmake -E true $((failed += $?))
191198
done
192199
exit $failed
193-
- name: Test examples
200+
- name: Test Examples
194201
if: runner.os == 'Windows'
195202
env:
196203
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}\clibs.8xg
197-
AUTOTESTER_ROM: ${{github.workspace}}\secrets\${{env.ROM}}
204+
AUTOTESTER_ROM: ${{env.SECRETS_PATH}}\${{env.ROM_FILE}}
205+
CEDEV: ${{env.INSTALL_PATH}}
198206
run: |
199207
$failed = 0
200-
foreach ($test in get-childitem "${{env.CEDEV}}\examples" -recurse -include autotest.json) {
208+
foreach ($test in get-childitem "${{env.INSTALL_PATH}}\examples" -recurse -include autotest.json) {
201209
cmake -E echo "Launching autotester on $test"
202210
autotester "$test"
203211
$failed += $lastexitcode
204212
}
205-
Exit $failed
213+
exit $failed
206214
207215
- name: Remove Secrets
208216
if: always()
209-
run: cmake -E rm -rf secrets
217+
run: cmake -E rm -rf ${{env.SECRETS_PATH}}
210218

211219
docs:
212220
runs-on: ubuntu-latest
213221
steps:
214-
- name: Bootstrap Documentation Environment
215-
if: runner.os == 'Windows'
216-
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
217-
- name: Prepare Documentation Environment
218-
if: runner.os == 'Linux'
219-
run: cmake -E echo >> $${{env.ENV}}GITHUB_PATH $HOME/.local/bin
220-
221222
- name: Install Documentation Dependencies
222223
if: runner.os == 'Linux'
223224
run: |
224225
sudo apt-get install -y doxygen
225226
pip install sphinx==3.2.1 sphinx_rtd_theme breathe
227+
cmake -E echo >> $${{matrix.env}}GITHUB_PATH $${{matrix.env}}HOME/.local/bin
226228
227229
- name: Checkout Toolchain
228230
uses: actions/checkout@v2.3.4
229231
with:
232+
path: ${{env.TOOLCHAIN_PATH}}
230233
persist-credentials: false
231234

232235
- name: Build Website Documentation
233-
run: |
234-
cd docs
235-
make html
236-
cd build/html
237-
touch .nojekyll
236+
run: make -C ${{env.TOOLCHAIN_PATH}}/docs html
237+
- name: Disable Jekyll
238+
run: cmake -E touch ${{env.TOOLCHAIN_PATH}}/docs/build/html/.nojekyll
238239

239240
- name: Upload Website Documentation
240241
if: github.ref == 'refs/heads/master'
241242
uses: JamesIves/github-pages-deploy-action@3.7.1
242243
with:
243-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
244+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
244245
BRANCH: gh-pages
245-
FOLDER: docs/build/html
246+
FOLDER: ${{env.TOOLCHAIN_PATH}}/docs/build/html
246247
CLEAN: true

0 commit comments

Comments
 (0)