diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 96354b6..e645881 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -18,29 +18,29 @@ jobs: language: - cpp steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - name: Install dependencies - run: | - sudo apt-get install -y cmake ninja-build ccache - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + - name: Install dependencies + run: | + sudo apt-get install -y cmake ninja-build ccache + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: key: ${{ github.job }} create-symlink: true - - name: Configure - run: > - cmake -S . -B build - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - - name: Build - run: | - cmake --build build --parallel - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Configure + run: > + cmake -S . -B build + -GNinja + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + - name: Build + run: | + cmake --build build --parallel + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 727982f..6c837e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,142 +10,142 @@ jobs: ubuntu-gcc-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install dependencies - run: | - sudo apt-get install -y cmake ninja-build ccache - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get install -y cmake ninja-build ccache + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: key: ${{ github.job }} create-symlink: true - - name: Configure - run: > - cmake -S . -B build - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - - name: Build - run: | - cmake --build build --parallel + - name: Configure + run: > + cmake -S . -B build + -GNinja + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + - name: Build + run: | + cmake --build build --parallel ubuntu-clang-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install dependencies - run: | - sudo apt-get install -y cmake ninja-build ccache - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get install -y cmake ninja-build ccache + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: key: ${{ github.job }} create-symlink: true - - name: Configure - run: > - cmake -S . -B build - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - - name: Build - run: | - cmake --build build --parallel + - name: Configure + run: > + cmake -S . -B build + -GNinja + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + - name: Build + run: | + cmake --build build --parallel windows-msvc-build: runs-on: windows-latest defaults: run: shell: bash steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 - with: - windows_compile_environment: msvc - - name: CMake configure - shell: bash - run: > - cmake -S . -B build - -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - - name: Build - shell: bash - run: | - cmake --build build --config Release --parallel + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Setup ccache + uses: Chocobo1/setup-ccache-action@v1 + with: + windows_compile_environment: msvc + - name: CMake configure + shell: bash + run: > + cmake -S . -B build + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + - name: Build + shell: bash + run: | + cmake --build build --config Release --parallel macos-clang-build: runs-on: macOS-latest steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install dependencies - run: | - brew install ninja - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install dependencies + run: | + brew install ninja + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: key: ${{ github.job }} create-symlink: true - - name: Configure - run: > - cmake -S . -B build - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - - name: Build - run: | - cmake --build build --parallel + - name: Configure + run: > + cmake -S . -B build + -GNinja + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + - name: Build + run: | + cmake --build build --parallel ubuntu-gcc-build-codecov: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install dependencies - run: | - sudo apt-get install -y cmake ninja-build ccache gcovr lcov - - uses: actions/checkout@v4 - with: - submodules: true - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install dependencies + run: | + sudo apt-get install -y cmake ninja-build ccache gcovr lcov + - uses: actions/checkout@v4 + with: + submodules: true + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: key: ${{ github.job }} create-symlink: true - - name: Configure - run: > - cmake -S . -B build - -GNinja - -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - -DCMAKE_C_FLAGS="--coverage" - -DCMAKE_CXX_FLAGS="--coverage" - - name: Build - run: | - cmake --build build --parallel - - name: Test - run: | - build/bin/run_tests - env: - CTEST_OUTPUT_ON_FAILURE: 1 - - name: Generate lcov Coverage Data - run: | - cd build - lcov --capture --directory . --output-file ../coverage.info - lcov --remove ../coverage.info '*/3rdparty/*' '/usr/*' '*/test/*' --output-file ../coverage.info - cd .. - genhtml coverage.info --output-directory cov-report - continue-on-error: true - - name: Upload coverage report artifact - uses: actions/upload-artifact@v4 - with: - name: cov-report - path: 'cov-report' - - name: Generate gcovr Coverage Data - run: | - cd build - gcovr -r ../include ../src --xml --output ../coverage.xml - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5.3.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: coverage.xml + - name: Configure + run: > + cmake -S . -B build + -GNinja + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + -DCMAKE_C_FLAGS="--coverage" + -DCMAKE_CXX_FLAGS="--coverage" + - name: Build + run: | + cmake --build build --parallel + - name: Test + run: | + build/bin/run_tests + env: + CTEST_OUTPUT_ON_FAILURE: 1 + - name: Generate lcov Coverage Data + run: | + cd build + lcov --capture --directory . --output-file ../coverage.info + lcov --remove ../coverage.info '*/3rdparty/*' '/usr/*' '*/test/*' --output-file ../coverage.info + cd .. + genhtml coverage.info --output-directory cov-report + continue-on-error: true + - name: Upload coverage report artifact + uses: actions/upload-artifact@v4 + with: + name: cov-report + path: 'cov-report' + - name: Generate gcovr Coverage Data + run: | + cd build + gcovr -r ../include ../src --xml --output ../coverage.xml + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5.3.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml diff --git a/.github/workflows/static-analysis-pr.yml b/.github/workflows/static-analysis-pr.yml index e725ddc..d142d6b 100644 --- a/.github/workflows/static-analysis-pr.yml +++ b/.github/workflows/static-analysis-pr.yml @@ -6,28 +6,33 @@ jobs: clang-tidy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: key: ${{ github.job }} - - uses: ZedThree/clang-tidy-review@v0.20.1 - id: review - name: Run clang-tidy - with: - build_dir: build - apt_packages: ninja-build - cmake_command: cmake -S . -B build -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - config_file: .clang-tidy - exclude: 3rdparty - split_workflow: true - lgtm_comment_body: "" - env: - CC: clang-16 - CXX: clang++-16 - - if: steps.review.outputs.total_comments > 0 - run: | - echo "clang-tidy run has failed. See 'Run clang-tidy' stage logs" - exit 1 + - uses: ZedThree/clang-tidy-review@v0.20.1 + id: review + name: Run clang-tidy + with: + build_dir: build + apt_packages: ninja-build + cmake_command: > + cmake -S . -B build + -DCMAKE_C_COMPILER_LAUNCHER=ccache + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + config_file: .clang-tidy + exclude: 3rdparty + split_workflow: true + lgtm_comment_body: "" + env: + CC: clang-16 + CXX: clang++-16 + - if: steps.review.outputs.total_comments > 0 + run: | + echo "clang-tidy run has failed. See 'Run clang-tidy' stage logs" + exit 1 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 65712d2..69748d2 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -6,17 +6,17 @@ jobs: clang-format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: DoozyX/clang-format-lint-action@v0.18.2 - with: - source: '.' + - uses: actions/checkout@v4 + - uses: DoozyX/clang-format-lint-action@v0.18.2 + with: + source: '.' python-lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Setup environment - run: | - python3 -m pip install flake8 - - name: Run linter - run: | - python3 -m flake8 . + - uses: actions/checkout@v4 + - name: Setup environment + run: | + python3 -m pip install flake8 + - name: Run linter + run: | + python3 -m flake8 . diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml new file mode 100644 index 0000000..b29cf0d --- /dev/null +++ b/.github/workflows/yaml-lint.yml @@ -0,0 +1,24 @@ +name: YAML Lint + +on: + pull_request: + paths: + - ".github/**/*.yml" + - ".github/**/*.yaml" + push: + paths: + - ".github/**/*.yml" + - ".github/**/*.yaml" + workflow_dispatch: + +jobs: + yaml-lint: + name: Validate YAML files + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install yamllint + run: python3 -m pip install yamllint + - name: Run yamllint + run: python3 -m yamllint . diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..d91de05 --- /dev/null +++ b/.yamllint @@ -0,0 +1,7 @@ +extends: default +rules: + line-length: + max: 120 + level: error + truthy: disable + document-start: disable