Add sscache to Windows CI #203
Workflow file for this run
This file contains 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: win64 | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
release: | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Windows 2022 MSVC", | |
os: windows-2022, | |
cc: "cl", | |
cxx: "cl", | |
build_type: "Debug", | |
generators: "Ninja" | |
} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 25 | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Setup VS Environment | |
uses: seanmiddleditch/gha-setup-vsdevenv@master | |
- name: Install sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Print env | |
run: | | |
echo github.ref: ${{github.ref}} | |
echo github.event.action: ${{github.event.action}} | |
echo github.event_name: ${{github.event_name}} | |
echo runner.os: ${{runner.os}} | |
Get-ChildItem Env: | |
- name: Install libraries with vcpkg | |
run: | | |
vcpkg --triplet x64-windows install eigen3 | |
- name: Eigen Introspection | |
run: | | |
type C:/vcpkg/packages/eigen3_x64-windows/debug/lib/pkgconfig/eigen3.pc | |
- name: Print sccache env | |
run: | | |
echo sccache version | |
sccache -V | |
- name: Configure CMake | |
run: | | |
cmake --version | |
cmake -B ${{github.workspace}}/build -G "${{matrix.config.generators}}" -DBUILD_UNITTESTS=ON -DG2O_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache | |
- name: Build Introspection | |
run: | | |
echo "g2o config.h" | |
type ${{github.workspace}}/build/g2o/config.h | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.config.build_type}} -j 2 | |
- name: Test | |
run: | | |
cd ${{github.workspace}}/build | |
$Env:PATH += ";${{github.workspace}}\bin\${{matrix.config.build_type}}" | |
$Env:PATH += ";${{github.workspace}}\lib\${{matrix.config.build_type}}" | |
$Env:PATH += ";${{github.workspace}}\build\bin\${{matrix.config.build_type}}" | |
$Env:PATH += ";${{github.workspace}}\build\lib\${{matrix.config.build_type}}" | |
ctest -C ${{matrix.config.build_type}} --extra-verbose --output-on-failure |