Skip to content

WIP: Vendor external #734

WIP: Vendor external

WIP: Vendor external #734

Workflow file for this run

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: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Lint
run: zig/bin/x86_64-linux/zig fmt --check . --exclude externals/
x86-64-linux:
needs: ["validation"]
name: x86-64 Linux
runs-on: linux-large
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch zig submodule
run: git submodule update --init externals/shared
- name: Prepare
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: kcov libdbus-1-dev
version: 1.0
#- uses: Schleifner/github-coredump@v1
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Zig cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/zig/
key: ${{ runner.arch }}-${{ runner.os }}-zig-cache
# - name: Zig build cache
# uses: actions/cache/restore@v4
# with:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache
- 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: Zig cache
uses: actions/cache/save@v4
with:
path: ~/.cache/zig/
key: ${{ runner.arch }}-${{ runner.os }}-zig-cache
# - name: Zig build cache
# uses: actions/cache/save@v4
# with:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache
- 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
# TODO: Fix linux CI
- 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 fixtures/test_asset/
- name: Test UI headless
run: zig-out/bin/cetech1 --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-13-large # macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch zig submodule
run: git submodule update --init externals/shared
# - name: Prepare`
# run: |
# brew update
# brew install kcov
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Zig cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/zig/
key: ${{ runner.arch }}-${{ runner.os }}-zig-cache
# - name: Zig build cache
# uses: actions/cache/restore@v4
# with:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache
- 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: Zig cache
uses: actions/cache/save@v4
with:
path: ~/.cache/zig/
key: ${{ runner.arch }}-${{ runner.os }}-zig-cache
# - name: Zig build cache
# uses: actions/cache/save@v4
# with:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache
- name: Test unit
run: TRACY_NO_INVARIANT_CHECK=1 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: TRACY_NO_INVARIANT_CHECK=1 zig-out/bin/cetech1 --headless --max-kernel-tick 5
- name: Test headless standalone with asset root
run: TRACY_NO_INVARIANT_CHECK=1 zig-out/bin/cetech1 --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
- name: Test UI headless
run: TRACY_NO_INVARIANT_CHECK=1 zig-out/bin/cetech1 --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: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch zig submodule
run: git submodule update --init externals/shared
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Zig cache
uses: actions/cache/restore@v4
with:
path: C:\Users\runneradmin\AppData\Local\zig
key: ${{ runner.arch }}-${{ runner.os }}-zig-cache
# - name: Zig build cache
# uses: actions/cache/restore@v4
# with:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache
- 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: Zig cache
uses: actions/cache/save@v4
with:
path: C:\Users\runneradmin\AppData\Local\zig
key: ${{ runner.arch }}-${{ runner.os }}-zig-cache
# - name: Zig build cache
# uses: actions/cache/save@v4
# with:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache
# - name: configure Pagefile
# uses: al-cheb/[email protected]
# with:
# minimum-size: 8GB
# maximum-size: 16GB
# disk-root: "C:"
- name: Test unit
shell: bash
run: zig-out/bin/cetech1_test
- name: Test headless standalone
shell: bash
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5
- name: Test headless standalone with asset root
shell: bash
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/
- name: Test UI headless
shell: bash
# TODO: bug with save result to file
#run: zig-out/bin/cetech1 --headless --test-ui --test-ui-junit ./result.xml
run: zig-out/bin/cetech1 --headless --test-ui