Skip to content

Merge branch 'main' into restore_msan #273

Merge branch 'main' into restore_msan

Merge branch 'main' into restore_msan #273

Workflow file for this run

name: Static Check
on: [push, workflow_dispatch]
env:
BUILD_TYPE: Release
jobs:
configure:
name: Get Compile Commands
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Upload Compile Commands
uses: actions/upload-artifact@v3
with:
name: compile_commands
path: ${{github.workspace}}/build/compile_commands.json
cppcheck:
name: CppCheck
needs: configure
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download Compile Commands
uses: actions/download-artifact@v3
with:
name: compile_commands
- name: Install CppCheck
run: |
sudo apt-get update
sudo apt-get install -y cppcheck
- name: Run CppCheck
shell: bash
# File test/test_simple_calc.cpp is ignored
run: |
cppcheck --project=${{github.workspace}}/compile_commands.json \
--std=c++17 \
--output-file=${{github.workspace}}/cppcheck-report.txt \
--suppress=preprocessorErrorDirective:${{github.workspace}}/catch2/catch.hpp .
- name: Upload CppCheck Result
uses: actions/upload-artifact@v3
with:
name: cppcheck_report
path: ${{github.workspace}}/cppcheck-report.txt
clang-tidy:
name: Clang Tidy
needs: configure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Compile Commands
uses: actions/download-artifact@v3
with:
name: compile_commands
- name: Create Build Folder
run: cmake -E make_directory ${{github.workspace}}/build
- name: Install Clang Tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy
sudo apt-get install -y clang-tools
- name: Run Clang Tidy
shell: bash
working-directory: ${{github.workspace}}/build
run: |
run-clang-tidy -checks='cppcoreguidelines-*,performance-*,readibility-*,modernize-*,-modernize-use-trailing-return-type,misc-*,clang-analyzer-*' \
-export-fixes ${{github.workspace}}/clang-tidy-fixes.yaml
- name: Upload Clang Tidy Result
uses: actions/upload-artifact@v3
with:
name: clang_tidy_fixes
path: ${{github.workspace}}/clang-tidy-fixes.yaml