Skip to content

Commit

Permalink
AssetDB, EditorUI, Editor, AssetBrowser, PropertiesEditor, Explorer, NFD
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraVoves committed Nov 11, 2023
1 parent c17e6d7 commit 12cb64b
Show file tree
Hide file tree
Showing 117 changed files with 12,541 additions and 1,207 deletions.
5 changes: 3 additions & 2 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ TARGET_ZIG_ARCH=$2
OPTIMIZE=$3

./bin/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} --verbose
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}
}

build false

ls -Rhal build/
ls -Rhan build/
6 changes: 3 additions & 3 deletions .ci/x86_64-linux-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OPTIMIZE=$1

mv build/${OPTIMIZE}/x86_64-linux zig-out
chmod -R 777 zig-out/
ls -Rhal zig-out/
ls -Rhan zig-out/

zig-out/bin/cetech1_test
zig-out/bin/cetech1 --max-kernel-tick 5
zig-out/bin/cetech1_test
zig-out/bin/cetech1 --headless --max-kernel-tick 5
2 changes: 1 addition & 1 deletion .ci/x86_64-macos-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ OPTIMIZE=$1
mv build/${OPTIMIZE}/x86_64-macos zig-out

zig-out/bin/cetech1_test
zig-out/bin/cetech1 --max-kernel-tick 5
zig-out/bin/cetech1 --headless --max-kernel-tick 5
13 changes: 12 additions & 1 deletion .ci/x86_64-windows-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ param (
[string]$optimize
)

function CheckLastExitCode {
if (!$?) {
exit 1
}
return 0
}


Move-Item -Path ./build/$optimize/x86_64-windows -Destination ./zig-out

zig-out/bin/cetech1_test.exe
zig-out/bin/cetech1.exe --max-kernel-tick 5
CheckLastExitCode

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

*.zig text eol=lf
*.zig text eol=lf

# .ct_ is prefix for cetech1 assets backed by JSON
*.ct_* linguist-language=json

81 changes: 50 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
name: "CI"
name: "Build & Test"

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

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

# paths:
# - "bin/**"
# - "src/**"
# - "include/**"
# - "externals/**"
# - "build.zig"

jobs:
build:
name: Cross-compile build
Expand All @@ -28,6 +26,9 @@ jobs:
with:
submodules: true

- name: Prepare
run: 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-macos Debug
Expand Down Expand Up @@ -60,7 +61,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: ".ci/x86_64-macos-test.sh"
sparse-checkout: |
.ci/x86_64-macos-test.sh
tests/
- name: Download build
uses: actions/cache@v3
with:
Expand All @@ -70,24 +73,29 @@ jobs:
- name: Test
run: sh .ci/x86_64-macos-test.sh Debug

test-x86_64-linux:
name: Test x86_64-linux Debug
runs-on: ubuntu-latest
timeout-minutes: 2
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: ".ci/x86_64-linux-test.sh"
- name: Download build
uses: actions/cache@v3
with:
path: build/Debug/x86_64-linux/
key: x86_64-linux-Debug-cache-${{ github.sha }}
fail-on-cache-miss: true
- name: Test
run: sh .ci/x86_64-linux-test.sh Debug
# 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
# timeout-minutes: 2
# needs: build
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# sparse-checkout: |
# .ci/x86_64-macos-linux.sh
# tests/
# - name: Download build
# uses: actions/cache@v3
# with:
# path: build/Debug/x86_64-linux/
# key: x86_64-linux-Debug-cache-${{ github.sha }}
# fail-on-cache-miss: true
# enableCrossOsArchive: true
# - name: Test
# run: sh .ci/x86_64-linux-test.sh Debug

test-x86_64-windows:
name: Test x86_64-windows Debug
Expand All @@ -98,14 +106,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: ".ci/x86_64-windows-test.ps1"
sparse-checkout: |
.ci/x86_64-windows-test.ps1
tests/
- name: Download build
uses: actions/cache@v3
with:
path: build/Debug/x86_64-windows/
key: x86_64-windows-Debug-cache-${{ github.sha }}
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: configure Pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 8GB
maximum-size: 16GB
disk-root: "C:"
- name: Test
run: .ci/x86_64-windows-test.ps1 Debug

Expand All @@ -118,7 +134,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 2
if: ${{ always() }}
needs: [test-x86_64-linux, test-x86_64-macos, test-x86_64-windows]
needs:
# - test-x86_64-linux
- test-x86_64-macos
- test-x86_64-windows
steps:
- name: Check out code
uses: actions/checkout@v3
Expand Down
120 changes: 100 additions & 20 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,121 @@
name: Docs
name: Build and publish docs

on:
workflow_call:
push:
branches: ["main"]
paths:
- "Writerside/**"

workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
pages: write
actions: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
env:
INSTANCE: Writerside/cetech1
ARTIFACT: webHelpCETECH12-all.zip
DOCKER_VERSION: 232.10165.1

jobs:
# Single deploy job since we're just deploying
build:
runs-on: ubuntu-latest

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

- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Save docs to cache
uses: actions/cache@v3
with:
key: docs-cache-${{ github.sha }}
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
test:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download docs
uses: actions/cache@v3
with:
key: docs-cache-${{ github.sha }}
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
fail-on-cache-miss: true

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}

deploy:
timeout-minutes: 5
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download docs
uses: actions/cache@v3
with:
submodules: true
key: docs-cache-${{ github.sha }}
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
fail-on-cache-miss: true

- name: Unzip artifact
uses: montudor/action-zip@v1
with:
args: unzip -qq artifacts/${{ env.ARTIFACT }} -d dir

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build docs
run: ci/gen-docs.sh x86_64-linux
uses: actions/configure-pages@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: 'docs'
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v2

cleanup:
runs-on: ubuntu-latest
timeout-minutes: 2
if: ${{ always() }}
needs: [build, test, deploy]
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
gh actions-cache delete docs-cache-${{ github.sha }} -R $REPO --confirm
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ zig-out
.DS_Store

kcov-output/

imgui.ini

# temp folder for tests
/tests/tmp

# folder for generated tmp data, cache and debug purpose files
.ct_temp
4 changes: 3 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
[submodule "externals/shared/lib/zig-gamedev"]
path = externals/shared/lib/zig-gamedev
url = https://github.com/OndraVoves/zig-gamedev.git
branch = tracy_update_0.10.0
[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
4 changes: 4 additions & 0 deletions .idea/.gitignore

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

8 changes: 8 additions & 0 deletions .idea/cetech1.iml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

Loading

0 comments on commit 12cb64b

Please sign in to comment.