Skip to content

Commit

Permalink
Filter, AssetInput, Modal, Create menu, Tags, Multi-select, D&D, Obje…
Browse files Browse the repository at this point in the history
…ct Buffer
  • Loading branch information
OndraVoves committed Mar 5, 2024
1 parent 05a858b commit ea90759
Show file tree
Hide file tree
Showing 123 changed files with 12,420 additions and 2,666 deletions.
15 changes: 6 additions & 9 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ set -x
set -e

ZIG_ARCH=$1
TARGET_ZIG_ARCH=$2
OPTIMIZE=$3
OPTIMIZE=$2

./bin/zig/lfs_pull.sh ${ZIG_ARCH}
./zig/lfs_pull.sh ${ZIG_ARCH}
./lfs_pull.sh

mkdir -p build/${OPTIMIZE}

function build() {
WITH_TRACY=$1
bin/zig/zig_${ZIG_ARCH} build -Dtarget=${TARGET_ZIG_ARCH} -Doptimize=${OPTIMIZE} -Dwith-tracy=${WITH_TRACY} -Dwith-nfd=false --verbose
mv zig-out build/${OPTIMIZE}/${TARGET_ZIG_ARCH}
WITH_NFD=$2
zig/bin/${ZIG_ARCH}/zig build --verbose -Doptimize=${OPTIMIZE} -Dwith-tracy=${WITH_TRACY} -Dwith-nfd=${WITH_NFD}
}

build false
build false true

ls -Rhan build/
ls -Rhan zig-out/
4 changes: 2 additions & 2 deletions .ci/gen-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ set -e

ZIG_ARCH=$1

./bin/zig/lfs_pull.sh ${ZIG_ARCH}
./zig/lfs_pull.sh ${ZIG_ARCH}

function build() {
bin/zig/zig_${ZIG_ARCH} build docs
zig/${ZIG_ARCH}/zig build docs
}

build x86_64-linux
10 changes: 10 additions & 0 deletions .ci/init_zig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -x
set -e

ZIG_ARCH=$1
OPTIMIZE=$2

./zig/lfs_pull.sh ${ZIG_ARCH}
./lfs_pull.sh
23 changes: 23 additions & 0 deletions .ci/xbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -x
set -e

ZIG_ARCH=$1
TARGET_ZIG_ARCH=$2
OPTIMIZE=$3

./zig/lfs_pull.sh ${ZIG_ARCH}
./lfs_pull.sh

mkdir -p build/${OPTIMIZE}

function build() {
WITH_TRACY=$1
zig/bin/${ZIG_ARCH}/zig build -Dtarget=${TARGET_ZIG_ARCH} -Doptimize=${OPTIMIZE} -Dwith-tracy=${WITH_TRACY} -Dwith-nfd=false --verbose
mv zig-out build/${OPTIMIZE}/${TARGET_ZIG_ARCH}
}

build false

ls -Rhan build/
2 changes: 1 addition & 1 deletion .ci/x86_64-linux-test.sh → .ci/xx86_64-linux-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ chmod -R 777 zig-out/
ls -Rhan zig-out/

zig-out/bin/cetech1_test
zig-out/bin/cetech1 --headless --max-kernel-tick 5
#zig-out/bin/cetech1 --headless --max-kernel-tick 5
File renamed without changes.
4 changes: 2 additions & 2 deletions .ci/x86_64-windows-test.ps1 → .ci/xx86_64-windows-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Move-Item -Path ./build/$optimize/x86_64-windows -Destination ./zig-out
zig-out/bin/cetech1_test.exe
CheckLastExitCode

zig-out/bin/cetech1.exe --headless --max-kernel-tick 5
CheckLastExitCode
#zig-out/bin/cetech1.exe --headless --max-kernel-tick 5
#CheckLastExitCode
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bin/zig/zig_* filter=lfs diff=lfs merge=lfs -texts
#bin/zig/zig_* filter=lfs diff=lfs merge=lfs -texts

*.zig text eol=lf

Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "Build & Test"
name: "XCompile Build & Test"

on:
pull_request:
push:
branches: ["main"]
#branches: ["main"]
paths:
- "bin/**"
- "src/**"
Expand All @@ -26,11 +26,11 @@ jobs:
with:
submodules: true

- name: Prepare
run: sudo apt-get install libgtk-3-dev
# - name: Prepare
# run: sudo apt-get update && sudo apt-get install libgtk-3-dev

- name: Build x86_64-linux Debug
run: .ci/build.sh x86_64-linux x86_64-linux Debug
# - name: Build x86_64-linux Debug
# run: .ci/build.sh x86_64-linux x86_64-linux-gnu Debug
- name: Build x86_64-macos Debug
run: .ci/build.sh x86_64-linux x86_64-macos Debug
- name: Build x86_64-windows Debug
Expand Down Expand Up @@ -73,8 +73,8 @@ jobs:
- name: Test
run: sh .ci/x86_64-macos-test.sh Debug

# TODO: i dont know why but i see files, persmision looks ok
# but cant run because file not found... WTF
# TODO: i dont know why but i see files, persmision looks ok
# but cant run because file not found... WTF
# test-x86_64-linux:
# name: Test x86_64-linux Debug
# runs-on: ubuntu-latest
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.2
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 8GB
maximum-size: 16GB
Expand All @@ -140,7 +140,7 @@ jobs:
- test-x86_64-windows
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cleanup
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ permissions:
env:
INSTANCE: Writerside/cetech1
ARTIFACT: webHelpCETECH12-all.zip
DOCKER_VERSION: 232.10165.1
DOCKER_VERSION: 233.14389

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
needs: [build, test, deploy]
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cleanup
run: |
Expand Down
148 changes: 148 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: "Build & Test"

on:
pull_request:
push:
#branches: ["main"]
paths:
- "src/**"
- "include/**"
- "externals/**"
- "build.zig"

concurrency:
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true

jobs:
validation:
name: Validation
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Prepare
run: .ci/init_zig.sh x86_64-linux
- name: Lint
run: zig/bin/x86_64-linux/zig fmt --check . --exclude externals/

x86-64-linux:
needs: ["validation"]
name: x86-64 Linux
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Prepare
run: sudo apt-get update && sudo apt-get install libgtk-3-dev kcov

- 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: Run test
run: kcov --include-pattern=cetech1/src/ 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

- name: Test headless standalone
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5

- name: Test headless standalone with asset root
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5 --asset-root tests/test_asset/

x86-64-macos:
needs: ["validation"]
name: x86-64 Macos
runs-on: macos-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Prepare
run: |
brew update
brew install kcov
- 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: Run test
run: zig-out/bin/cetech1_test

- name: Test headless standalone
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5

- name: Test headless standalone with asset root
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5 --asset-root tests/test_asset/

x86-64-windows:
needs: ["validation"]
name: x86-64 Windows
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- 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/[email protected]
with:
minimum-size: 8GB
maximum-size: 16GB
disk-root: "C:"

- name: Run test with kcov
run: zig-out/bin/cetech1_test.exe

- name: Test headless standalone
run: zig-out/bin/cetech1.exe --headless --max-kernel-tick 5

- name: Test headless standalone with asset root
run: zig-out/bin/cetech1.exe --headless --max-kernel-tick 5 --asset-root tests/test_asset/
21 changes: 15 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
[submodule "bin/zig"]
path = bin/zig
url = https://github.com/cyberegoorg/cetech1-zig.git
[submodule "externals/shared/lib/zig-gamedev"]
path = externals/shared/lib/zig-gamedev
url = https://github.com/OndraVoves/zig-gamedev.git
[submodule "externals/shared/lib/zig-uuid"]
path = externals/shared/lib/zig-uuid
url = https://github.com/tensorush/zig-uuid.git
[submodule "externals/shared/lib/nfd-zig"]
path = externals/shared/lib/nfd-zig
url = https://github.com/fabioarnold/nfd-zig.git
[submodule "externals/shared/lib/zf"]
path = externals/shared/lib/zf
url = https://github.com/natecraddock/zf.git
[submodule "externals/shared/tools/zls"]
path = externals/shared/tools/zls
url = https://github.com/zigtools/zls.git
[submodule "zig"]
path = zig
url = https://github.com/cyberegoorg/cetech1-zig.git
[submodule "externals/shared/lib/mach-gamemode"]
path = externals/shared/lib/mach-gamemode
url = https://github.com/hexops/mach-gamemode.git
[submodule "externals/shared/lib/SDL_GameControllerDB"]
path = externals/shared/lib/SDL_GameControllerDB
url = https://github.com/mdqinc/SDL_GameControllerDB.git
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .lldbinit-template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
command script import <CHANGE_ME_TO_REPODIR>/bin/zig/tools/lldb_pretty_printers.py
command script import <CHANGE_ME_TO_REPODIR>/zig/tools/lldb_pretty_printers.py
type category enable zig
type category enable zig.std
8 changes: 8 additions & 0 deletions .space.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
job("Hello world") {
git {
// Do not download large files
env["GIT_LFS_SKIP_SMUDGE"] = "1"
}

container(displayName = "Say hello", image = "hello-world")
}
Loading

0 comments on commit ea90759

Please sign in to comment.