refactor: migrate to cpp 23 #1
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: PR check | |
on: | |
pull_request: | |
branches: [ "master" ] | |
paths-ignore: | |
- '.github/**' | |
- '.gitignore' | |
- 'README' | |
- 'LICENCE' | |
- '*.gif' | |
- '*.jpeg' | |
- '*.jpg' | |
- '*.jpg' | |
env: | |
BUILD_TYPE: Release | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: ['clang','msvc','gcc'] | |
os: ['ubuntu-latest', 'windows-latest'] | |
exclude: | |
- os: 'ubuntu-latest' | |
compiler: 'msvc' | |
- os: 'windows-latest' | |
# temporary exclude everything | |
# compiler: 'gcc' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache | |
id: cache-step | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/vcpkg | |
./build/vcpkg_installed | |
${{ env.CONAN_USER_HOME }} | |
~/.cache/pip | |
${{ env.HOME }}/.cache/vcpkg/archives | |
${{ env.XDG_CACHE_HOME }}/vcpkg/archives | |
${{ env.LOCALAPPDATA }}\vcpkg\archives | |
${{ env.APPDATA }}\vcpkg\archives | |
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('**/CMakeLists.txt') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.compiler }} | |
- name: Prepare environment | |
uses: aminya/setup-cpp@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
vcvarsall: ${{ contains(matrix.os, 'windows' )}} | |
cmake: true | |
ninja: true | |
conan: false | |
vcpkg: false | |
ccache: false | |
clangtidy: false | |
cppcheck: false | |
gcovr: false | |
opencppcoverage: false | |
- name: Setup vcpkg and install Boost (Windows) | |
if: steps.cache-step.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git | |
cd vcpkg | |
./bootstrap-vcpkg.bat | |
./vcpkg install boost | |
- name: Get boost | |
if: matrix.os != 'windows-latest' | |
run: sudo apt-get update && sudo apt-get install libboost-program-options-dev libgit2-dev | |
- name: Configure CMake (Windows) | |
if: matrix.os == 'windows-latest' | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
- name: Configure CMake (Windows) | |
if: matrix.os != 'windows-latest' | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config Release | |
- name: Test | |
working-directory: ${{ github.workspace }}/build | |
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure | |
static-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cpp-linter/cpp-linter-action@v2 | |
id: linter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
version: 16 | |
style: 'file' # Use .clang-format config file | |
tidy-checks: '' # Use .clang-tidy config file | |
# only 'update' a single comment in a pull request's thread. | |
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} | |
- name: Fail fast?! | |
if: steps.linter.outputs.checks-failed > 0 | |
run: exit 1 | |