Skip to content

Commit 5027e4e

Browse files
committed
WIP: Editor & Runner, actions as module, cleanup ci, platform => host, input source interface, input debuger
1 parent e70146c commit 5027e4e

File tree

151 files changed

+4904
-2482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+4904
-2482
lines changed

.ci/build.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

.ci/gen-docs.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.
File renamed without changes.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
# *.jpg filter=lfs diff=lfs merge=lfs -text
44
# *.ttf filter=lfs diff=lfs merge=lfs -text
55

6+
externals/* linguist-vendored
7+
68
*.zig text eol=lf

.github/workflows/test.yaml

Lines changed: 38 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -34,57 +34,64 @@ 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
4239
timeout-minutes: 10
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
os:
44+
- linux-large
45+
- macos-15-large
46+
- windows-large
47+
48+
runs-on: ${{matrix.os}}
49+
50+
env:
51+
TRACY_NO_INVARIANT_CHECK: "1" #TODO: remove
52+
4353
steps:
4454
- name: Checkout
4555
uses: actions/checkout@v4
4656

47-
- name: Prepare
48-
# uses: awalsh128/cache-apt-pkgs-action@latest
49-
# with:
50-
# packages: kcov libdbus-1-dev
51-
# version: 1.0
57+
- if: runner.os == 'Linux'
58+
name: Prepare linux
5259
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
60+
61+
- if: runner.os == 'Linux'
62+
name: Install kcov
5663
run: |
5764
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
5865
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
5966
wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz
6067
sudo tar xf kcov-amd64.tar.gz -C /
6168
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-
7169
- name: Install Zig
7270
uses: mlugg/setup-zig@v2
71+
72+
- name: Init repo
73+
shell: bash
74+
run: zig build init
75+
7376
- name: Build
74-
run: .ci/build.sh x86_64-linux Debug
77+
shell: bash
78+
run: zig build -Doptimize=Debug -Dwith_shaderc=false
7579

7680
- name: Upload build
7781
uses: actions/upload-artifact@v4
7882
with:
79-
name: x86-64-linux-bin
83+
name: ${{matrix.os}}-bin
8084
path: zig-out/
8185
overwrite: true
8286
retention-days: 1
8387

84-
- name: Test unit
88+
- if: runner.os == 'Linux'
89+
name: Test unit with kcov
90+
shell: bash
8591
run: kcov --include-pattern=/cetech1/src/,/cetech/public/ kcov-output zig-out/bin/cetech1_test
8692

87-
- name: Upload code coverage report to Codecov
93+
- if: runner.os == 'Linux'
94+
name: Upload code coverage report to Codecov
8895
uses: codecov/codecov-action@v4
8996
with:
9097
directory: kcov-output
@@ -94,128 +101,15 @@ jobs:
94101
verbose: true
95102
flags: unittests
96103

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-
# uses: al-cheb/[email protected]
197-
# with:
198-
# minimum-size: 8GB
199-
# maximum-size: 16GB
200-
# disk-root: "C:"
201-
202-
- name: Test unit
104+
- if: runner.os != 'Linux'
105+
name: Test unit without kcov
203106
shell: bash
204107
run: zig-out/bin/cetech1_test
205-
206-
# FIXME: Windows
207-
- name: Test headless standalone
208-
shell: bash
209-
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5
210-
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/
214-
215-
- name: Test UI headless
216-
shell: bash
217-
run: zig-out/bin/cetech1 --headless --test-ui --test-ui-junit ./result.xml
218108

109+
# FIXME: Windows
110+
- if: runner.os != 'Windows'
111+
name: Test UI headless
112+
run: zig-out/bin/cetech1_editor --headless --test-ui --test-ui-junit ./result.xml
219113
- name: Publish Test Report
220114
uses: mikepenz/action-junit-report@v4
221115
if: success() || failure() # always run even if the previous step fails

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ _static.zig
3737
.vscode/launch.json
3838
.vscode/settings.json
3939

40-
# Fleet
41-
.fleet/settings.json
42-
.fleet/run.json
43-
4440
# Idea
4541
.idea/
4642
Zig.iml
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
.{
22
.launchers = .{
3+
.{ .name = "CETech1 unit tests", .program = .{ .path = "zig-out/bin/cetech1_test" }, .args = .{} },
34
.{ .name = "CETech1 no asset root", .args = .{} },
45
.{ .name = "CETech1 max 5 tick", .args = .{ "--max-kernel-tick", "5", "--asset-root", "fixtures/test_asset/" } },
56
.{ .name = "CETech1 --headless", .args = .{ "--max-kernel-tick", "5", "--asset-root", "fixtures/test_asset/", "--headless" } },
6-
.{ .name = "CETech1 Tests", .program = "zig-out/bin/cetech1_test", .args = .{} },
77
.{ .name = "CETech1 Tests UI", .args = .{"--test-ui"} },
88
.{ .name = "CETech1 Tests UI (headless)", .args = .{ "--test-ui", "--headless", "--test-ui-junit", "./result.xml" } },
99
.{ .name = "CETech1 (Vulkan)", .args = .{ "--asset-root", "fixtures/test_asset/", "--renderer", "bgfx_vulkan" } },
10+
.{ .name = "CETech1 runner world", .program = .runner, .args = .{ "--asset-root", "fixtures/test_graph/", "--simulate", "0198d6b0-9580-74d8-b06f-e4df9723720a", "--runner-ui" } },
11+
.{ .name = "CETech1 runner explode", .program = .runner, .args = .{ "--asset-root", "fixtures/test_graph/", "--simulate", "0191e6d1-830a-73d8-992a-aa6f9add6d1e", "--simulate-explode", "100", "--runner-ui" } },
1012
},
1113
}

0 commit comments

Comments
 (0)