Windows support #312
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y gcc-11 g++-11 | |
sudo apt-get install autoconf automake autoconf-archive | |
sudo apt install -y inotify-tools libxmu-dev libxi-dev libgl-dev | |
sudo apt install -y libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev | |
python3 -m pip install --upgrade pip | |
pip3 install pytest-xdist | |
- name: Cache Vcpkg Packages | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-vcpkg | |
with: | |
path: | | |
${{github.workspace}}/vcpkg/ | |
${{github.workspace}}/build/vcpkg_installed/ | |
!${{github.workspace}}/vcpkg/buildtrees | |
!${{github.workspace}}/vcpkg/packages | |
!${{github.workspace}}/vcpkg/downloads | |
key: ${{runner.os}}-build-${{env.cache-name}}-${{hashFiles('**/vcpkg.json')}} | |
- name: Setup Vcpkg | |
working-directory: ${{github.workspace}} | |
run: | | |
if [ ! -d "${{github.workspace}}/vcpkg" ]; then | |
git clone https://github.com/microsoft/vcpkg.git | |
fi | |
if [ ! -f "${{github.workspace}}/vcpkg/vcpkg" ]; then | |
sh vcpkg/bootstrap-vcpkg.sh | |
fi | |
env: | |
VCPKG_TARGET_TRIPLET: x64-linux | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: | | |
bash build.sh ${{env.BUILD_TYPE}} all | |
pip3 install -e build/lib/${{env.BUILD_TYPE}} | |
env: | |
VCPKG_PATH: ${{github.workspace}}/vcpkg | |
CC: gcc-11 | |
CXX: g++-11 | |
- name: Run Unit Tests | |
working-directory: ${{github.workspace}}/build/galtest | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest . --rerun-failed --output-on-failure | |
- name: Run Python Tests | |
working-directory: ${{github.workspace}}/scripts | |
run: pytest -n 4 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: galproject-build | |
path: | | |
${{github.workspace}}/build/galview | |
${{github.workspace}}/build/pygalfunc.so | |
${{github.workspace}}/build/CascadiaMono.ttf | |
${{github.workspace}}/build/*.glsl | |
${{github.workspace}}/build/setup.py | |
retention-days: 2 | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install Dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install pytest-xdist | |
- name: Cache Vcpkg Packages | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-vcpkg | |
with: | |
path: | | |
${{github.workspace}}/vcpkg/ | |
${{github.workspace}}/build/vcpkg_installed/ | |
!${{github.workspace}}/vcpkg/buildtrees | |
!${{github.workspace}}/vcpkg/packages | |
!${{github.workspace}}/vcpkg/downloads | |
key: ${{runner.os}}-build-${{env.cache-name}}-${{hashFiles('**/vcpkg.json')}} | |
- name: Setup Vcpkg | |
working-directory: ${{github.workspace}} | |
run: | | |
if (-not (Test-Path "$env:GITHUB_WORKSPACE\vcpkg")) { | |
git clone https://github.com/microsoft/vcpkg.git | |
} | |
if (-not (Test-Path "$env:GITHUB_WORKSPACE\vcpkg\vcpkg")) { | |
& "$env:GITHUB_WORKSPACE\vcpkg\bootstrap-vcpkg.bat" | |
} | |
env: | |
VCPKG_TARGET_TRIPLET: x64-windows-static | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: | | |
cmd /c "build.bat ${{env.BUILD_TYPE}} ALL_BUILD" | |
pip3 install -e build/lib/{{env.BUILD_TYPE}} | |
env: | |
VCPKG_PATH: ${{github.workspace}}/vcpkg | |
- name: Run Unit Tests | |
working-directory: ${{github.workspace}}/build/galtest | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest . --rerun-failed --output-on-failure | |
- name: Run Python Tests | |
working-directory: ${{github.workspace}}/scripts | |
run: pytest -n 4 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: galproject-build | |
path: | | |
${{github.workspace}}/build/galview | |
${{github.workspace}}/build/pygalfunc.so | |
${{github.workspace}}/build/CascadiaMono.ttf | |
${{github.workspace}}/build/*.glsl | |
${{github.workspace}}/build/setup.py | |
retention-days: 2 |