-
Notifications
You must be signed in to change notification settings - Fork 0
225 lines (189 loc) · 6.75 KB
/
test.yaml
File metadata and controls
225 lines (189 loc) · 6.75 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
name: Test
permissions:
checks: write
on:
pull_request:
push:
#branches: ["main"]
# paths:
# - ".github/workflows/test.yaml"
# - "src/**"
# - "public/**"
# - "externals/**"
# - "modules/**"
# - "fixtures/**"
# - "build.zig"
# - "build.zig.zon"
concurrency:
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true
jobs:
validation:
name: Validation
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
- name: Lint
run: zig fmt --check . --exclude externals/
x86-64-linux:
needs: ["validation"]
name: x86-64 Linux
runs-on: linux-large
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
# uses: awalsh128/cache-apt-pkgs-action@latest
# with:
# packages: kcov libdbus-1-dev
# version: 1.0
run: sudo apt update && sudo apt install -y libdbus-1-dev
# TODO: https://github.com/SimonKagstrom/kcov/issues/471
- name: Install kcov
run: |
sudo ln -s /usr/lib/x86_64-linux-gnu/libbfd-2.42-system.so /usr/lib/x86_64-linux-gnu/libbfd-2.38-system.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libopcodes-2.42-system.so /usr/lib/x86_64-linux-gnu/libopcodes-2.38-system.so
wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz
sudo tar xf kcov-amd64.tar.gz -C /
# KCOV_VERSION=v43 && \
# sudo apt install -y git cmake g++ libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev binutils-dev && \
# git clone https://github.com/SimonKagstrom/kcov.git && \
# cd kcov && git checkout ${KCOV_VERSION} && mkdir build && cd build && \
# cmake .. && make && sudo make install && \
# kcov --version
#- uses: Schleifner/github-coredump@v1
- name: Install Zig
uses: mlugg/setup-zig@v2
- name: Build
run: .ci/build.sh x86_64-linux Debug
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: x86-64-linux-bin
path: zig-out/
overwrite: true
retention-days: 1
- name: Test unit
run: kcov --include-pattern=/cetech1/src/,/cetech/public/ kcov-output zig-out/bin/cetech1_test
- name: Upload code coverage report to Codecov
uses: codecov/codecov-action@v4
with:
directory: kcov-output
token: ${{ secrets.CODECOV_TOKEN }}
slug: cyberegoorg/cetech1
fail_ci_if_error: true
verbose: true
flags: unittests
# - name: Setup headless display
# uses: pyvista/setup-headless-display-action@v2
- name: Test headless standalone
run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5
- name: Test headless standalone with asset root
run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
- name: Test UI headless
run: zig-out/bin/cetech1_editor --headless --test-ui --test-ui-junit ./result.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "./result.xml"
fail_on_failure: true
require_passed_tests: true
require_tests: true
detailed_summary: true
x86-64-macos:
needs: ["validation"]
name: x86-64 Macos
runs-on: macos-15-large # macos-latest
timeout-minutes: 10
env:
TRACY_NO_INVARIANT_CHECK: "1" #TODO: remove
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Prepare`
# run: |
# brew update
# brew install kcov
- name: Install Zig
uses: mlugg/setup-zig@v2
- name: Build
run: .ci/build.sh x86_64-macos Debug
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: x86-64-macos-bin
path: zig-out/
overwrite: true
retention-days: 1
- name: Test unit
run: zig-out/bin/cetech1_test
#run: kcov --include-pattern=/cetech1/src/,/cetech/public/ kcov-output zig-out/bin/cetech1_test
- name: Test headless standalone
run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5
- name: Test headless standalone with asset root
run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
- name: Test UI headless
run: zig-out/bin/cetech1_editor --headless --test-ui --test-ui-junit ./result.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "./result.xml"
fail_on_failure: true
require_passed_tests: true
require_tests: true
detailed_summary: true
x86-64-windows:
needs: ["validation"]
name: x86-64 Windows
runs-on: windows-large # windows-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
- name: Build
shell: bash
run: .ci/build.sh x86_64-windows Debug
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: x86-64-windows-bin
path: zig-out/
overwrite: true
retention-days: 1
# - name: configure Pagefile
# uses: al-cheb/configure-pagefile-action@v1.4
# with:
# minimum-size: 8GB
# maximum-size: 16GB
# disk-root: "C:"
- name: Test unit
shell: bash
run: zig-out/bin/cetech1_test
# FIXME: Windows
# - name: Test headless standalone
# shell: bash
# run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5
# - name: Test headless standalone with asset root
# shell: bash
# run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
# - name: Test UI headless
# shell: bash
# run: zig-out/bin/cetech1_editor --headless --test-ui --test-ui-junit ./result.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "./result.xml"
fail_on_failure: true
require_passed_tests: true
require_tests: true
detailed_summary: true