| name: Tests |
| on: |
| push: |
| |
| jobs: |
| # ---------- Linux ---------- |
| unit_linux: |
| runs-on: ubuntu-latest |
| defaults: { run: { shell: bash } } |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - name: Tooling |
| run: | |
| sudo apt-get update |
| sudo apt-get install -y build-essential uuid-dev clang llvm lld |
| curl -sL -o premake.tar.gz https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz |
| tar -xf premake.tar.gz |
| sudo install -m 0755 premake5 /usr/local/bin/premake5 |
| |
| - name: Add build scripts to PATH |
| run: echo "${{ github.workspace }}/build" >> "$GITHUB_PATH" # official way to extend PATH |
| # ^ GITHUB_PATH is the supported mechanism. :contentReference[oaicite:2]{index=2} |
| |
| - name: Unit tests |
| working-directory: tests/unit_tests |
| run: | |
| ./test.sh # builds and runs ./out/<cfg>/unit_tests |
| |
| # ---------- Windows (MSVC) ---------- |
| unit_windows_msvc: |
| runs-on: windows-2022 |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: microsoft/setup-msbuild@v1.3 # puts msbuild on PATH :contentReference[oaicite:3]{index=3} |
| |
| - name: Add build scripts to PATH |
| shell: bash |
| run: echo "${{ github.workspace }}/build" >> "$GITHUB_PATH" |
| |
| - name: Unit tests (no GPU) |
| shell: cmd |
| working-directory: tests\unit_tests |
| run: | |
| setlocal EnableDelayedExpansion & rem needed if you loop over files later :contentReference[oaicite:4]{index=4} |
| call test.bat --toolset=msc --factory=null |
| endlocal |
| |
| # ---------- Windows (clang-cl) ---------- |
| unit_windows_clang: |
| runs-on: windows-2022 |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: microsoft/setup-msbuild@v1.3 |
| |
| - name: Add build scripts to PATH |
| shell: bash |
| run: echo "${{ github.workspace }}/build" >> "$GITHUB_PATH" |
| |
| - name: Unit tests (clang-cl, no GPU) |
| shell: cmd |
| working-directory: tests\unit_tests |
| run: call test.bat --factory=null |
| |
| # ---------- macOS ---------- |
| unit_macos: |
| runs-on: macos-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - name: Tooling |
| run: | |
| curl -sL -o premake_macosx.tar.gz https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-macosx.tar.gz |
| tar -xf premake_macosx.tar.gz |
| sudo install -m 0755 premake5 /usr/local/bin/premake5 |
| - name: Add build scripts to PATH |
| run: echo "${{ github.workspace }}/build" >> "$GITHUB_PATH" |
| - name: Unit tests |
| working-directory: tests/unit_tests |
| run: ./test.sh |