Files
libultraship/.github/workflows/test-validation.yml
CopilotandKenix3 00a563b819 Add Windows test CI job (#1092)
* Add test-windows job to test-validation workflow

Agent-Logs-Url: https://github.com/Kenix3/libultraship/sessions/7bca4a6c-8653-403a-881a-c85c9ce7d441

Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>

* Fix Windows test build: use /Z7 debug info to avoid sccache PDB conflict

Agent-Logs-Url: https://github.com/Kenix3/libultraship/sessions/21d961cb-c604-4163-b61b-cd3c80f2efeb

Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>

* Enable CMP0141 policy so CMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded is respected

Agent-Logs-Url: https://github.com/Kenix3/libultraship/sessions/f545789a-0f27-4a06-a21b-6cf95e8cf507

Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>

* Override prism's explicit /ZI with /Z7 for sccache compatibility on Windows

Agent-Logs-Url: https://github.com/Kenix3/libultraship/sessions/52516a3b-be95-4c22-946d-86dcc3aa1be7

Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>

* Pass -DCMAKE_POLICY_DEFAULT_CMP0141=NEW on cmake command line to fix prism /Fd sccache issue

Agent-Logs-Url: https://github.com/Kenix3/libultraship/sessions/aece2440-91e9-4dbe-aca7-6ae690e23b1d

Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>

* Fix prism sccache failure by clearing compiler launcher on prism target

Agent-Logs-Url: https://github.com/Kenix3/libultraship/sessions/57b95c2a-37d1-4a2c-a58c-a1f1c3a3fae9

Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>

* Fix WriteAllText to use binary mode so \n is not translated to \r\n on Windows

Agent-Logs-Url: https://github.com/Kenix3/libultraship/sessions/b07b0bb3-15cb-4b16-92ab-ce6a9cc938e8

Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Kenix3 <18299654+Kenix3@users.noreply.github.com>
2026-04-28 18:20:10 -04:00

107 lines
3.7 KiB
YAML

name: test-validation
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.14
with:
key: ${{ runner.os }}-test-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-test-ccache-${{ github.ref }}
${{ runner.os }}-test-ccache-
- name: Install latest SDL
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/release/SDL2-2.24.1.tar.gz
tar -xzf SDL2-2.24.1.tar.gz
cd SDL2-2.24.1
./configure
make -j $(nproc)
sudo make install
- name: Install latest tinyxml2
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
tar -xzf 10.0.0.tar.gz
cd tinyxml2-10.0.0
mkdir build
cd build
cmake ..
make
sudo make install
- name: Install Python dependencies
run: python3 -m pip install -r requirements.txt
- name: Configure
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-test -GNinja \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DLUS_BUILD_TESTS=ON
env:
CC: gcc-12
CXX: g++-12
- name: Build
run: cmake --build build-test --config Debug --parallel $(nproc)
- name: Run tests
run: ctest --test-dir build-test --output-on-failure
env:
SDL_VIDEODRIVER: dummy
SDL_AUDIODRIVER: dummy
test-windows:
runs-on: windows-latest
permissions:
contents: read
steps:
- name: Install dependencies
run: |
choco install ninja
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.14
with:
variant: sccache
key: ${{ runner.os }}-test-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-test-ccache-${{ github.ref }}
${{ runner.os }}-test-ccache-
- name: Cache vcpkg
uses: actions/cache@v4
with:
save-always: true
key: ${{ runner.os }}-test-vcpkg-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-test-vcpkg-${{ github.ref }}
${{ runner.os }}-test-vcpkg-
path: D:/a/vcpkg
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Python dependencies
run: python -m pip install -r requirements.txt
- name: Configure
env:
VCPKG_ROOT: D:/a/vcpkg
run: |
$env:PATH = "$env:USERPROFILE\.cargo\bin;$env:PATH"
$PY_EXE = (Get-Command python).Definition
cmake --no-warn-unused-cli -S. -Bbuild-test -GNinja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded -DUSE_AUTO_VCPKG=ON -DCMAKE_VS_PLATFORM_NAME=x64 "-DPython3_EXECUTABLE=$PY_EXE" -DPython3_FIND_REGISTRY=NEVER -DLUS_BUILD_TESTS=ON
- name: Build
run: cmake --build build-test --config Debug --parallel 10
- name: Run tests
run: ctest --test-dir build-test --output-on-failure
env:
SDL_VIDEODRIVER: dummy
SDL_AUDIODRIVER: dummy