testing ccache #47
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: ci | |
on: | |
pull_request: | |
release: | |
types: [published] | |
push: | |
tags: | |
branches: | |
- main | |
- master | |
- test-ccache-and-ninja | |
jobs: | |
Test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
#- macos-latest | |
#- windows-2022 | |
compiler: | |
# you can specify the version after `-` like "llvm-15.0.2". | |
- llvm-17 | |
- gcc-13 | |
build_type: | |
- Release | |
include: | |
# Windows msvc builds | |
- os: windows-latest | |
compiler: msvc | |
build_type: Release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./build | |
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('**/CMakeLists.txt') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.compiler }} | |
- name: Install dependencies (linux) | |
run: sudo apt update && sudo apt install ninja-build libopencv-dev libpoco-dev | |
if: matrix.os == 'ubuntu-latest' | |
- name: Install dependencies (windows) | |
run: | | |
choco install opencv --version 4.10.0 -y --package-parameters '/InstallationPath:C:\opencv /Environment' | |
echo "C:\opencv\opencv\build\x64\vc16\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
if: matrix.os == 'windows-latest' | |
- name: Setup Cpp | |
uses: aminya/setup-cpp@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
vcvarsall: ${{ contains(matrix.os, 'windows' )}} | |
ninja: true | |
ccache: true | |
- name: Configure CMake (windows) | |
run: cmake -S . -B ./build -G "Ninja Multi-Config" | |
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} | |
-DOpenCV_DIR="C:/opencv/opencv/build/" | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
if: matrix.os == 'windows-latest' | |
- name: Configure CMake (linux) | |
run: cmake -S . -B ./build -G "Ninja Multi-Config" | |
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: | | |
cmake --build ./build --config ${{matrix.build_type}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure |