WIP: Editor & Runner, actions as module #1043
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Install Zig | |
| uses: mlugg/setup-zig@v2 | |
| - name: Lint | |
| run: zig fmt --check . --exclude externals/ | |
| build: | |
| needs: ["validation"] | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - linux-large | |
| - macos-15-large | |
| - windows-large | |
| runs-on: ${{matrix.os}} | |
| env: | |
| TRACY_NO_INVARIANT_CHECK: "1" #TODO: remove | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - if: runner.os == 'Linux' | |
| name: Prepare linux | |
| run: sudo apt update && sudo apt install -y libdbus-1-dev | |
| - if: runner.os == 'Linux' | |
| name: Install kcov | |
| run: | | |
| 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 | |
| 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 | |
| wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz | |
| sudo tar xf kcov-amd64.tar.gz -C / | |
| - name: Install Zig | |
| uses: mlugg/setup-zig@v2 | |
| - name: Init cetech repo | |
| shell: bash | |
| run: zig build init | |
| - name: Build | |
| shell: bash | |
| run: zig build -Doptimize=Debug -Dwith_shaderc=false | |
| - name: Upload build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{matrix.os}}-bin | |
| path: zig-out/ | |
| overwrite: true | |
| retention-days: 1 | |
| - if: runner.os == 'Linux' | |
| name: Test unit with kcov | |
| shell: bash | |
| run: kcov --include-pattern=/cetech1/src/,/cetech/public/ kcov-output zig-out/bin/cetech1_test | |
| - if: runner.os == 'Linux' | |
| 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 | |
| - if: runner.os != 'Linux' | |
| name: Test unit without kcov | |
| shell: bash | |
| run: zig-out/bin/cetech1_test | |
| # FIXME: Windows | |
| - if: runner.os != 'Windows' | |
| name: Test headless standalone | |
| run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5 | |
| - if: runner.os != 'Windows' | |
| name: Test headless standalone with asset root | |
| run: zig-out/bin/cetech1_editor --headless --max-kernel-tick 5 --asset-root fixtures/test_asset/ | |
| - if: runner.os != 'Windows' | |
| name: Test UI headless | |
| run: zig-out/bin/cetech1_editor --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 |