Skip to content

Commit aeda262

Browse files
committed
Clean up workflow by splitting testing to a separate job.
This also serves as a check that the CEdev zip contains everything necessary to compile the examples. Also, only deploy documentation for pushes to master.
1 parent 37438ea commit aeda262

File tree

1 file changed

+52
-23
lines changed

1 file changed

+52
-23
lines changed

.github/workflows/make.yml

Lines changed: 52 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- master
1010

1111
jobs:
12-
build-and-test:
12+
build:
1313
strategy:
1414
fail-fast: false
1515
matrix:
@@ -20,15 +20,10 @@ jobs:
2020
if: runner.os == 'Windows'
2121
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
2222
- name: Prepare Build Environment
23-
run: |
24-
cmake -E echo >> $${{env.ENV}}GITHUB_ENV ROM=84pce_515_53.rom
25-
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CEDEV=${{github.workspace}}/CEdev
26-
cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEdev/bin
27-
cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEmu/tests/autotester
23+
run: cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEdev/bin
2824
- name: Prepare Build Environment
2925
if: runner.os == 'Windows'
30-
run: |
31-
cmake -E echo >> $${{env.ENV}}GITHUB_ENV EXE=.exe
26+
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV EXE=.exe
3227

3328
- name: Install Build Dependencies
3429
if: runner.os == 'Linux'
@@ -54,7 +49,7 @@ jobs:
5449
run: ez80-clang --version
5550

5651
- name: Checkout Toolchain
57-
uses: actions/checkout@v2
52+
uses: actions/checkout@v2.3.4
5853
with:
5954
path: toolchain
6055
submodules: recursive
@@ -97,47 +92,74 @@ jobs:
9792
name: installer-${{runner.os}}
9893
path: toolchain\release\CEdev${{env.EXE}}
9994

95+
test:
96+
needs: build
97+
if: github.event_name != 'pull_request'
98+
strategy:
99+
fail-fast: false
100+
matrix:
101+
runs-on: [ubuntu-latest, macos-latest, windows-latest]
102+
runs-on: ${{matrix.runs-on}}
103+
steps:
104+
- name: Bootstrap Test Environment
105+
if: runner.os == 'Windows'
106+
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
107+
- name: Prepare Test Environment
108+
run: |
109+
cmake -E echo >> $${{env.ENV}}GITHUB_ENV ROM=84pce_515_53.rom
110+
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CEDEV=${{github.workspace}}/CEdev
111+
cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEdev/bin
112+
cmake -E echo >> $${{env.ENV}}GITHUB_PATH ${{github.workspace}}/CEmu/tests/autotester
113+
114+
- name: Download CEdev
115+
uses: actions/download-artifact@v2
116+
with:
117+
name: CEdev-${{runner.os}}
118+
path: CEdev
119+
- name: Download Libraries
120+
uses: actions/download-artifact@v2
121+
with:
122+
name: clibs
123+
124+
- name: Make Binaries Executable
125+
if: runner.os != 'Windows'
126+
run: chmod +x ${{env.CEDEV}}/bin/*
127+
100128
- name: Build Examples
101129
run: make -j4 -C ${{env.CEDEV}}/examples V=1
102130

103131
- name: Checkout CEmu
104-
if: github.event_name == 'push'
105-
uses: actions/checkout@v2
132+
uses: actions/checkout@v2.3.4
106133
with:
107134
repository: CE-Programming/CEmu
108135
ref: latest-stable
109136
path: CEmu
110137

111138
- name: Build CEmu
112-
if: github.event_name == 'push'
113139
run: make -j4 -C CEmu/core
114140
- name: Build Autotester CLI
115-
if: github.event_name == 'push'
116141
run: make -j4 -C CEmu/tests/autotester
117142

118143
- name: Download Secrets
119-
if: github.event_name == 'push'
120144
id: download-secrets
121145
uses: carlosperate/download-file-action@v1.0.3
122146
with:
123147
file-url: https://jacobly.com/CE-Programming/secrets
124148
location: secrets
125149
- name: Decrypt Secrets
126-
if: github.event_name == 'push'
127150
env:
128151
KEY: ${{secrets.SYMMETRIC_KEY_256}}
129152
run: openssl enc -d -aes-256-cbc -iv d0583d991fcb6c3b05fb8eabc7421fb8 -K "$${{env.ENV}}KEY" -in ${{steps.download-secrets.outputs.file-path}} -out secrets/secrets.7z
130153
- name: Extract Secrets
131-
if: github.event_name == 'push'
132154
uses: DuckSoft/extract-7z-action@v1.0
133155
with:
134156
pathSource: secrets/secrets.7z
135157
pathTarget: secrets
136158

137159
- name: Test examples
138-
if: github.event_name == 'push' && runner.os != 'Windows'
160+
if: runner.os != 'Windows'
139161
env:
140-
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}/toolchain/clibs.8xg
162+
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}/clibs.8xg
141163
AUTOTESTER_ROM: ${{github.workspace}}/secrets/${{env.ROM}}
142164
run: |
143165
failed=0
@@ -148,9 +170,9 @@ jobs:
148170
done
149171
exit $failed
150172
- name: Test examples
151-
if: github.event_name == 'push' && runner.os == 'Windows'
173+
if: runner.os == 'Windows'
152174
env:
153-
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}\toolchain\clibs.8xg
175+
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}\clibs.8xg
154176
AUTOTESTER_ROM: ${{github.workspace}}\secrets\${{env.ROM}}
155177
run: |
156178
$failed = 0
@@ -168,15 +190,21 @@ jobs:
168190
docs:
169191
runs-on: ubuntu-latest
170192
steps:
193+
- name: Bootstrap Documentation Environment
194+
if: runner.os == 'Windows'
195+
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
196+
- name: Prepare Documentation Environment
197+
if: runner.os == 'Linux'
198+
run: cmake -E echo >> $${{env.ENV}}GITHUB_PATH $HOME/.local/bin
171199

172-
- name: Install Build Dependencies
200+
- name: Install Documentation Dependencies
201+
if: runner.os == 'Linux'
173202
run: |
174-
cmake -E echo >> $${{env.ENV}}GITHUB_PATH $HOME/.local/bin
175203
sudo apt-get install -y doxygen
176204
pip install sphinx==3.2.1 sphinx_rtd_theme breathe
177205
178206
- name: Checkout Toolchain
179-
uses: actions/checkout@v2.3.1
207+
uses: actions/checkout@v2.3.4
180208
with:
181209
persist-credentials: false
182210

@@ -188,6 +216,7 @@ jobs:
188216
touch .nojekyll
189217
190218
- name: Upload Website Documentation
219+
if: github.ref == 'refs/heads/master'
191220
uses: JamesIves/github-pages-deploy-action@3.7.1
192221
with:
193222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)