@@ -34,57 +34,59 @@ jobs:
3434
3535 - name : Lint
3636 run : zig fmt --check . --exclude externals/
37-
38- x86-64-linux :
37+ build :
3938 needs : ["validation"]
40- name : x86-64 Linux
41- runs-on : linux-large
39+ strategy :
40+ fail-fast : false
41+ matrix :
42+ os :
43+ - linux-large
44+ - macos-15-large
45+ - windows-large
4246 timeout-minutes : 10
47+ runs-on : ${{matrix.os}}
4348 steps :
4449 - name : Checkout
4550 uses : actions/checkout@v4
4651
47- - name : Prepare
48- # uses: awalsh128/cache-apt-pkgs-action@latest
49- # with:
50- # packages: kcov libdbus-1-dev
51- # version: 1.0
52- run : sudo apt update && sudo apt install -y libdbus-1-dev
53-
54- # TODO: https://github.com/SimonKagstrom/kcov/issues/471
55- - name : Install kcov
56- run : |
57- 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
58- 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
59- wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz
60- sudo tar xf kcov-amd64.tar.gz -C /
61-
62- # KCOV_VERSION=v43 && \
63- # sudo apt install -y git cmake g++ libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev binutils-dev && \
64- # git clone https://github.com/SimonKagstrom/kcov.git && \
65- # cd kcov && git checkout ${KCOV_VERSION} && mkdir build && cd build && \
66- # cmake .. && make && sudo make install && \
67- # kcov --version
68-
69- # - uses: Schleifner/github-coredump@v1
70-
7152 - name : Install Zig
7253 uses : mlugg/setup-zig@v2
54+
55+ - name : Init cetech repo
56+ shell : bash
57+ run : zig build init
58+
7359 - name : Build
74- run : .ci/build.sh x86_64-linux Debug
60+ shell : bash
61+ run : zig build -Doptimize=Debug -Dwith_shaderc=false
7562
7663 - name : Upload build
7764 uses : actions/upload-artifact@v4
7865 with :
79- name : x86-64-linux -bin
66+ name : ${{matrix.os}} -bin
8067 path : zig-out/
8168 overwrite : true
8269 retention-days : 1
8370
84- - name : Test unit
71+ - if : runner.os == 'Linux'
72+ name : Prepare linux
73+ run : sudo apt update && sudo apt install -y libdbus-1-dev
74+
75+ - if : runner.os == 'Linux'
76+ name : Install kcov
77+ run : |
78+ 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
79+ 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
80+ wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz
81+ sudo tar xf kcov-amd64.tar.gz -C /
82+
83+ - if : runner.os == 'Linux'
84+ name : Test unit with kcov
85+ shell : bash
8586 run : kcov --include-pattern=/cetech1/src/,/cetech/public/ kcov-output zig-out/bin/cetech1_test
8687
87- - name : Upload code coverage report to Codecov
88+ - if : runner.os == 'Linux'
89+ name : Upload code coverage report to Codecov
8890 uses : codecov/codecov-action@v4
8991 with :
9092 directory : kcov-output
@@ -94,127 +96,24 @@ jobs:
9496 verbose : true
9597 flags : unittests
9698
97- # - name: Setup headless display
98- # uses: pyvista/setup-headless-display-action@v2
99-
100- - name : Test headless standalone
101- run : zig-out/bin/cetech1 --headless --max-kernel-tick 5
102-
103- - name : Test headless standalone with asset root
104- run : zig-out/bin/cetech1 --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
105-
106- - name : Test UI headless
107- run : zig-out/bin/cetech1 --headless --test-ui --test-ui-junit ./result.xml
108-
109- - name : Publish Test Report
110- uses : mikepenz/action-junit-report@v4
111- if : success() || failure() # always run even if the previous step fails
112- with :
113- report_paths : " ./result.xml"
114- fail_on_failure : true
115- require_passed_tests : true
116- require_tests : true
117- detailed_summary : true
118-
119- x86-64-macos :
120- needs : ["validation"]
121- name : x86-64 Macos
122- runs-on : macos-15-large # macos-latest
123- timeout-minutes : 10
124- env :
125- TRACY_NO_INVARIANT_CHECK : " 1" # TODO: remove
126- steps :
127- - name : Checkout
128- uses : actions/checkout@v4
129-
130- # - name: Prepare`
131- # run: |
132- # brew update
133- # brew install kcov
134-
135- - name : Install Zig
136- uses : mlugg/setup-zig@v2
137- - name : Build
138- run : .ci/build.sh x86_64-macos Debug
139-
140- - name : Upload build
141- uses : actions/upload-artifact@v4
142- with :
143- name : x86-64-macos-bin
144- path : zig-out/
145- overwrite : true
146- retention-days : 1
147-
148- - name : Test unit
149- run : zig-out/bin/cetech1_test
150- # run: kcov --include-pattern=/cetech1/src/,/cetech/public/ kcov-output zig-out/bin/cetech1_test
151-
152- - name : Test headless standalone
153- run : zig-out/bin/cetech1 --headless --max-kernel-tick 5
154-
155- - name : Test headless standalone with asset root
156- run : zig-out/bin/cetech1 --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
157-
158- - name : Test UI headless
159- run : zig-out/bin/cetech1 --headless --test-ui --test-ui-junit ./result.xml
160-
161- - name : Publish Test Report
162- uses : mikepenz/action-junit-report@v4
163- if : success() || failure() # always run even if the previous step fails
164- with :
165- report_paths : " ./result.xml"
166- fail_on_failure : true
167- require_passed_tests : true
168- require_tests : true
169- detailed_summary : true
170-
171- x86-64-windows :
172- needs : ["validation"]
173- name : x86-64 Windows
174- runs-on : windows-large # windows-latest
175- timeout-minutes : 10
176- steps :
177- - name : Checkout
178- uses : actions/checkout@v4
179-
180- - name : Install Zig
181- uses : mlugg/setup-zig@v2
182-
183- - name : Build
184- shell : bash
185- run : .ci/build.sh x86_64-windows Debug
186-
187- - name : Upload build
188- uses : actions/upload-artifact@v4
189- with :
190- name : x86-64-windows-bin
191- path : zig-out/
192- overwrite : true
193- retention-days : 1
194-
195- # - name: configure Pagefile
196- 197- # with:
198- # minimum-size: 8GB
199- # maximum-size: 16GB
200- # disk-root: "C:"
201-
202- - name : Test unit
99+ - if : runner.os != 'Linux'
100+ name : Test unit without kcov
203101 shell : bash
204102 run : zig-out/bin/cetech1_test
205-
103+
206104 # FIXME: Windows
207- - name : Test headless standalone
208- shell : bash
209- run : zig-out/bin/cetech1 --headless --max-kernel-tick 5
105+ - if : runner.os != 'Windows'
106+ name : Test headless standalone
107+ run : zig-out/bin/cetech1_editor --headless --max-kernel-tick 5
210108
211- - name : Test headless standalone with asset root
212- shell : bash
213- run : zig-out/bin/cetech1 --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
109+ - if : runner.os != 'Windows'
110+ name : Test headless standalone with asset root
111+ run : zig-out/bin/cetech1_editor --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
112+
113+ - if : runner.os != 'Windows'
114+ name : Test UI headless
115+ run : zig-out/bin/cetech1_editor --headless --test-ui --test-ui-junit ./result.xml
214116
215- - name : Test UI headless
216- shell : bash
217- run : zig-out/bin/cetech1 --headless --test-ui --test-ui-junit ./result.xml
218117
219118 - name : Publish Test Report
220119 uses : mikepenz/action-junit-report@v4
@@ -224,4 +123,4 @@ jobs:
224123 fail_on_failure : true
225124 require_passed_tests : true
226125 require_tests : true
227- detailed_summary : true
126+ detailed_summary : true
0 commit comments