Skip to content

Upgrade to C++23 from C++17 #117

Upgrade to C++23 from C++17

Upgrade to C++23 from C++17 #117

Workflow file for this run

name: C++ linter
on:
push:
branches: [ "main" ]
paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake', '**.clang_format', '**.clang-format-ignore', '**.clang-tidy', '**.clangd', '.github/workflows/cpp-linter.yml']
pull_request:
branches: [ "main" ]
paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake', '**.clang_format', '**.clang-format-ignore', '**.clang-tidy', '**.clangd', '.github/workflows/cpp-linter.yml']
jobs:
cpp-linter:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_COMPILER=clang
-DCMAKE_BUILD_TYPE=Debug
-S ${{ github.workspace }}
-DUFO_BUILD_TESTS=ON
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 21
style: 'file' # Use .clang-format config file
tidy-checks: '' # Use .clang-tidy config file
ignore: 'external'
lines-changed-only: true
tidy-review: false
format-review: false
thread-comments: ${{ github.event_name == 'pull_request' && 'update' || 'false' }}
database: ${{ steps.strings.outputs.build-output-dir }}
- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1