Fix CI #1035
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
# | |
# Copyright (c) 2021, RTE (http://www.rte-france.com) | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
# | |
name: clang-tidy | |
on: | |
pull_request: | |
types: [opened, synchronize, edited] | |
jobs: | |
qa: | |
name: clang-tidy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Boost | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libboost-all-dev | |
- name: Install clang-tidy | |
run: | | |
sudo apt-get install -y clang-tidy-14 | |
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 100 | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Configure CMake | |
run: > | |
cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build | |
-DCMAKE_BUILD_TYPE=Debug | |
-DCMAKE_PREFIX_PATH=$BOOST_ROOT_1_72_0 | |
-DBUILD_EXAMPLES=ON | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
- name: Clang Tidy | |
run: | | |
export MODIFIED_FILES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep -E "\.(cpp|hpp|hxx)$") | |
if [ -n "$MODIFIED_FILES" ]; then | |
clang-tidy $MODIFIED_FILES -p $GITHUB_WORKSPACE/build | |
fi |