Skip to content

Improve windows workflow #3

Improve windows workflow

Improve windows workflow #3

Workflow file for this run

name: Windows
on:
pull_request:
jobs:
build:
name: Window CI
env:
LIBRARY_NAME: gz-rendering
COLCON_BUILD_CMD: 'colcon build --merge-install --event-handlers console_direct+ --cmake-args -G"Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release'
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
path: src/gz-rendering
- name: Determine major version
shell: bash
run: |
curl -LO https://raw.githubusercontent.com/gazebo-tooling/release-tools/master/jenkins-scripts/tools/detect_cmake_major_version.py
echo PACKAGE="$LIBRARY_NAME$(python3 detect_cmake_major_version.py src/gz-rendering/CMakeLists.txt)" >> $GITHUB_ENV
- name: setup-pixi
uses: prefix-dev/[email protected]
with:
run-install: false
- name: Install build tools
run: |
pixi init
pixi add vcstool colcon-common-extensions pkgconfig
- name: Set up environment variables
run: |
# Set environment variables globally
pixi shell-hook | Out-String | Invoke-Expression
("CMAKE_PREFIX_PATH=${env:CONDA_PREFIX}\Library") >> $env:GITHUB_ENV
("PATH=${env:PATH};${env:GITHUB_WORKSPACE}\install\bin") >> $env:GITHUB_ENV
- name: Install base dependencies
# List adapted from https://github.com/gazebo-tooling/release-tools/blob/f89ac8cafc646260598eb8eb6d94be8093bdc9f7/jenkins-scripts/lib/windows_env_vars.bat#L22
run: pixi add assimp dlfcn-win32 eigen ffmpeg freeimage gdal gflags ogre ogre-next spdlog tinyxml2
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: sscache environment
shell: bash
run: |
echo CMAKE_C_COMPILER_LAUNCHER="$SCCACHE_PATH" >> $GITHUB_ENV
echo CMAKE_CXX_COMPILER_LAUNCHER="$SCCACHE_PATH" >> $GITHUB_ENV
- name: Clone source dependencies
run: vcs import --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/${env:PACKAGE}.yaml --skip-existing --repos src
- name: Build Dependencies
run: pixi run ${env:COLCON_BUILD_CMD} -DBUILD_TESTING=OFF --packages-skip ${env:PACKAGE}
- name: Build Package
run: pixi run ${env:COLCON_BUILD_CMD} -DBUILD_TESTING=ON -DSKIP_ogre=ON --packages-select ${env:PACKAGE}
- name: Test
run: |
. install\setup.ps1
colcon test --merge-install --event-handlers console_direct+ --packages-select ${env:PACKAGE}