Skip to content

Update .clang-tidy

Update .clang-tidy #5

Workflow file for this run

name: CI
on:
push:
branches:
- '**'
- '!main'
env:
BUILD_TYPE: Debug
LINTERS_FLAGS_ON: -DENABLE_CLANG_TIDY=ON -DENABLE_CPPLINT=ON -DENABLE_CPPCHECK=ON
LINTERS_FLAGS_OFF: -DENABLE_CLANG_TIDY=OFF -DENABLE_CPPLINT=OFF -DENABLE_CPPCHECK=OFF
TEST_FLAGS_ON: -DENABLE_TEST=ON -DENABLE_SANITIZER=ON
TEST_FLAGS_OFF: -DENABLE_TEST=OFF -DENABLE_SANITIZER=OFF
BACK_FRONT_ON: -DENABLE_BACKEND=ON -DENABLE_FRONTEND=ON
jobs:
build-with-linters:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install boost
run: sudo apt-get install libboost-all-dev
- name: Install pqxx for postgresql
run: sudo apt-get install libpqxx-dev
- name: Install nlohmann-json3
run: sudo apt-get install nlohmann-json3-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.*'
- name: Install cppcheck
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y cppcheck
- name: Install clang-tidy
run: sudo apt-get install -y clang-tidy
- name: Install python
uses: actions/setup-python@v4
- name: Install cpplint
run: sudo pip install cpplint
- name: Configure cmake
run: |
cmake -B ${{ github.workflow }}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
${{ env.LINTERS_FLAGS_ON }} ${{ env.TEST_FLAGS_OFF }} ${{ env.BACK_FRONT_ON }}
cd ${{ github.workflow }}
- name: Build with linters
id: build-with-linters-step
run: |
cmake --build ${{ github.workflow }}/build 2>&1 | tee ${{ github.workflow }}/build_output.txt
RESULT_CODE=${PIPESTATUS[0]}
echo "BUILD_OUTPUT<<EOF" >> $GITHUB_OUTPUT
echo "$(cat ${{ github.workflow }}/build_output.txt)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
exit $RESULT_CODE
- name: Save results to PR comment
uses: mshick/add-pr-comment@v2
with:
message: |
## Results of build with clang-tidy, cpplint, cppcheck
```
echo ${{ steps.build-with-linters-step.outputs.BUILD_OUTPUT }}
```
- name: Save build results to artifact
uses: actions/upload-artifact@v3
with:
name: Results of build with clang-tidy, cpplint, cppcheck
path: ${{ github.workflow }}/build_output.txt
tests:
runs-on: ubuntu-latest
permissions: write-all
needs: [ build-with-linters ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install boost
run: |
sudo apt-get install libboost-all-dev
- name: Install pqxx for postgresql
run: sudo apt-get install libpqxx-dev
- name: Install nlohmann-json3
run: sudo apt-get install nlohmann-json3-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.*'
- name: Configure cmake
run: |
cmake -B ${{ github.workflow }}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
${{ env.LINTERS_FLAGS_OFF }} ${{ env.TEST_FLAGS_ON }} ${{ env.BACK_FRONT_ON }}
- name: Build
run: cmake --build ${{ github.workflow }}/build
- name: Run tests
id: run-tests
run: |
${{ github.workflow }}/build/tests/run_tests.sh 2>&1 | tee ${{ github.workflow }}/tests_output.txt
RESULT_CODE=${PIPESTATUS[0]}
echo "TESTS_OUTPUT<<EOF" >> $GITHUB_OUTPUT
echo "$(cat ${{ github.workflow }}/tests_output.txt)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
exit $RESULT_CODE
- name: Save results to PR comment
uses: mshick/add-pr-comment@v2
with:
message: |
## Tests Results
```
echo ${{ steps.run-tests.outputs.TESTS_OUTPUT }}
```
- name: Save build results to artifact
uses: actions/upload-artifact@v3
with:
name: Tests Results
path: ${{ github.workflow }}/tests_output.txt