Update tests.yml #852
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: Tests | |
| on: | |
| push: | |
| jobs: | |
| # -------------------- Linux -------------------- | |
| unit_linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Premake | |
| run: | | |
| wget -q https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz | |
| tar -xf premake-5.0.0-beta2-linux.tar.gz | |
| sudo install -m 0755 premake5 /usr/local/bin/premake5 | |
| - name: Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential uuid-dev clang llvm lld | |
| - name: Add build scripts to PATH | |
| run: echo "${{ github.workspace }}/build" >> $GITHUB_PATH | |
| - name: Build | |
| shell: bash | |
| run: | | |
| cd tests/unit_tests | |
| ../../build_rive.sh --file=premake5_v2.lua --with_rive_audio=system --with_rive_scripting debug | |
| ../../build_rive.sh --file=premake5_v2.lua --with_rive_audio=system --with_rive_scripting release | |
| - name: Unit tests | |
| run: | | |
| ./test.sh | |
| if [ -x ./out/debug/unit_tests ]; then | |
| ./out/debug/unit_tests | |
| elif [ -x ./out/release/unit_tests ]; then | |
| ./out/release/unit_tests | |
| else | |
| echo "No unit_tests binary found!" && exit 1 | |
| fi | |
| # -------------------- Windows (clang-cl toolset) -------------------- | |
| unit_windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: microsoft/[email protected] | |
| - 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: | | |
| set UT= | |
| for /r out %%f in (unit_tests.exe) do ( | |
| set UT=%%f | |
| goto :found | |
| ) | |
| echo Could not find unit_tests.exe && exit /b 1 | |
| :found | |
| echo Found: !UT! | |
| rem show what factories are compiled in (for debugging) | |
| "!UT!" --list-factories | |
| rem run with a safe factory on CI | |
| "!UT!" --factory=null || "!UT!" --factory=warp || exit /b 1 | |
| # -------------------- Windows (MSVC toolset) -------------------- | |
| unit_windows_msvc: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: microsoft/[email protected] | |
| - name: Add build scripts to PATH | |
| shell: bash | |
| run: echo "${{ github.workspace }}/build" >> $GITHUB_PATH | |
| - name: Unit tests (MSVC, no GPU) | |
| shell: cmd | |
| working-directory: tests/unit_tests | |
| run: .\test.bat --toolset=msc --factory=null | |
| # -------------------- macOS -------------------- | |
| unit_macos: | |
| runs-on: macOS-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Premake | |
| run: | | |
| curl -L -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 (no ASan) | |
| run: | | |
| cd tests/unit_tests | |
| ./test.sh | |
| # Tess (kept as separate; builds and runs both variants) | |
| - name: Tess tests | |
| run: | | |
| set -euo pipefail | |
| cd tess | |
| # Debug/default | |
| ../build/build_rive.sh --file=premake5_tess.lua | |
| DBG_BIN=$(find ./out -type f -name 'rive_tess_tests*' -perm -111 -print -quit) | |
| echo "Debug tess binary: ${DBG_BIN:-<not found>}" | |
| test -n "${DBG_BIN:-}" && "$DBG_BIN" | |
| # Release | |
| ../build/build_rive.sh --file=premake5_tess.lua release | |
| REL_BIN=$(find ./out -type f -name 'rive_tess_tests*' -perm -111 -print -quit) | |
| echo "Release tess binary: ${REL_BIN:-<not found>}" | |
| test -n "${REL_BIN:-}" && "$REL_BIN" |