forked from longturn/freeciv21
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
137068d
commit 4f5bb16
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: clang-tidy-review | ||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: clang-tidy | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
compiler: [gcc] | ||
build_type: [Debug] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Set base_dir | ||
run: echo "base_dir=$(pwd)" >> $GITHUB_ENV | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install GCC | ||
if: ${{ matrix.compiler == 'gcc' }} | ||
run: | | ||
sudo apt-get install g++ | ||
- name: Install clang | ||
if: ${{ matrix.compiler == 'clang' }} | ||
run: | | ||
sudo apt-get install clang | ||
export CC=$(which clang) | ||
export CXX=$(which clang++) | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install \ | ||
cmake \ | ||
ninja-build \ | ||
python3 \ | ||
gettext \ | ||
qtbase5-dev \ | ||
libqt5svg5-dev \ | ||
libkf5archive-dev \ | ||
liblua5.3-dev \ | ||
libsqlite3-dev \ | ||
libsdl2-mixer-dev | ||
- name: Configure | ||
run: | | ||
cmake . -B build -G Ninja \ | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=on | ||
- name: Build | ||
run: | | ||
cmake --build build | ||
- uses: ZedThree/[email protected] | ||
id: review | ||
with: | ||
# Tell clang-tidy-review the base directory. | ||
# This will get replaced by the new working | ||
# directory inside the action | ||
base_dir: ${{ matrix.base_dir }} | ||
|
||
# If there are any comments, fail the check | ||
- if: steps.review.outputs.total_comments > 0 | ||
run: exit 1 |