Projection adjustments #214
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: clang-tidy | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- "xpano/**" | |
- "tests/**" | |
- "misc/cmake/**" | |
- "CMakeLists.txt" | |
- ".clang-tidy" | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
env: | |
BUILD_TYPE: Release | |
CATCH_VERSION: "v3.5.0" | |
EXIV2_VERSION: "v0.28.1" | |
jobs: | |
clang-tidy-check: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libopencv-dev libsdl2-dev libspdlog-dev | |
- name: Cache Catch | |
uses: actions/cache@v3 | |
id: cache-catch | |
with: | |
path: catch/install | |
key: ${{runner.os}}-catch-${{env.CATCH_VERSION}}-${{env.BUILD_TYPE}}-22.04 | |
- name: Install Catch | |
if: steps.cache-catch.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/catchorg/Catch2.git catch --depth 1 --branch $CATCH_VERSION | |
cd catch | |
cmake -B build -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTING=OFF | |
cmake --build build -j $(nproc) --target install | |
cd .. | |
- name: Cache exiv2 | |
uses: actions/cache@v3 | |
id: cache-exiv2 | |
with: | |
path: exiv2/install | |
key: ${{runner.os}}-exiv2-${{env.EXIV2_VERSION}}-${{env.BUILD_TYPE}}-22.04 | |
- name: Install exiv2 | |
if: steps.cache-exiv2.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/Exiv2/exiv2.git --depth 1 --branch $EXIV2_VERSION | |
cd exiv2 | |
cmake -B build \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
`cat ../misc/build/exiv2-minimal-flags.txt` | |
cmake --build build --target install -j $(nproc) | |
cd .. | |
- name: Configure CMake | |
run: | | |
cmake -B build \ | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | |
-DBUILD_TESTING=ON \ | |
-DCatch2_ROOT=`pwd`/catch/install \ | |
-Dexiv2_ROOT=`pwd`/exiv2/install | |
- name: Run clang-tidy | |
run: | | |
run-clang-tidy-15 `pwd`/xpano `pwd`/tests \ | |
-p=build \ | |
-quiet \ | |
-header-filter=xpano/xpano.*xpano \ | |
-export-fixes=fixes.yml | |
- name: Check clang-tidy results | |
run: | | |
pip install -r misc/scripts/python/requirements.txt | |
python misc/scripts/python/check_fixes.py fixes.yml |