feature/bump vcpkg baseline #390
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
name: Continuous Integration | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
VCPKG_COMMIT: "d5ec528843d29e3a52d745a64b469f810b2cedbf" | |
jobs: | |
version_bump: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Test version bumped | |
if: github.ref != 'refs/heads/main' | |
run: echo "$(git diff HEAD origin/main version.py)" | grep __version__ -wq | |
lint: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: { python-version: "3.8" } | |
- name: Install codespell | |
run: pip3 install codespell | |
- name: Install LLVM and Clang | |
uses: ./.github/actions/install-clang | |
with: | |
version: "19" | |
- name: Lint | |
run: cmake -D FORMAT_COMMAND=clang-format-19 -P cmake/lint.cmake | |
- name: Spell check | |
if: always() | |
run: cmake -P cmake/spell.cmake | |
sonar: | |
needs: lint | |
if: ${{ !cancelled() && (needs.lint.result == 'success' || needs.lint.result == 'skipped') }} # Don't skip on main build, even though lint is skipped. | |
runs-on: ubuntu-24.04 | |
env: | |
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Install LLVM and Clang | |
uses: ./.github/actions/install-clang | |
with: | |
version: "19" | |
- name: Install Build Wrapper | |
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4 | |
- name: Install vcpkg | |
uses: friendlyanon/setup-vcpkg@v1 | |
with: | |
committish: "${{ env.VCPKG_COMMIT }}" | |
cache-key: "vcpkg-sonar-<hash>" | |
- name: Configure | |
run: | | |
cmake --preset=ci-coverage | |
- name: Build with build-wrapper | |
run: | | |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build -j 4 | |
- name: Test and code coverage | |
timeout-minutes: 10 | |
run: cmake --build build -t ccov-all -j 4 | |
- name: Run sonar-scanner | |
uses: SonarSource/sonarqube-scan-action@v4 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" | |
- name: clang-tidy | |
run: | | |
python3 -m venv .venv && source .venv/bin/activate | |
pip3 install clangd-tidy | |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
bash ./tools/run_clangd_tidy_on_changed.sh all # all files | |
else | |
bash ./tools/run_clangd_tidy_on_changed.sh # only changed files | |
fi | |
- name: Run include what you use check. | |
run: ./tools/check_include_what_you_use.sh # if this fails you can run the script locally. | |
sanitize: | |
needs: [lint] | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install LLVM and Clang | |
uses: ./.github/actions/install-clang | |
with: | |
version: "19" | |
- name: Install vcpkg | |
uses: friendlyanon/setup-vcpkg@v1 | |
with: | |
committish: "${{ env.VCPKG_COMMIT }}" | |
cache-key: "vcpkg-sanitize-<hash>" | |
- name: Configure | |
run: cmake --preset=ci-sanitize | |
- name: Build | |
run: cmake --build build -j 2 | |
- name: Test | |
run: ctest --preset=sanitize -j 2 | |
test: | |
needs: [lint] | |
strategy: | |
matrix: | |
os: [ubuntu-24.04] | |
compiler: [gcc-11, gcc-12, gcc-13, gcc-14, clang-18, clang-19] | |
include: | |
- os: windows-22 | |
compiler: msvc | |
- os: macos-13 | |
compiler: gcc-11 | |
- os: macos-13 | |
compiler: gcc-12 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract compiler version | |
if: matrix.os == 'ubuntu-24.04' | |
id: extract-version | |
run: | | |
COMPILER_VERSION=$(echo "${{ matrix.compiler }}" | cut -d'-' -f2) | |
echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_OUTPUT | |
- name: Install LLVM and Clang | |
if: matrix.os == 'ubuntu-24.04' && contains(matrix.compiler, 'clang') | |
uses: ./.github/actions/install-clang | |
with: | |
version: ${{ steps.extract-version.outputs.COMPILER_VERSION }} | |
- name: Install GCC | |
if: matrix.os == 'ubuntu-24.04' && contains(matrix.compiler, 'gcc') | |
uses: ./.github/actions/install-gcc | |
with: | |
version: ${{ steps.extract-version.outputs.COMPILER_VERSION }} | |
- name: Install vcpkg | |
uses: friendlyanon/setup-vcpkg@v1 | |
with: | |
committish: "${{ env.VCPKG_COMMIT }}" | |
cache-key: "vcpkg-${{ matrix.os }}-${{ matrix.compiler }}-<hash>" | |
- name: Configure | |
shell: pwsh | |
run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])-${{ matrix.compiler }}" | |
- name: Build | |
run: cmake --build build --config Release -j 2 | |
- name: Install | |
run: cmake --install build --config Release --prefix prefix | |
- name: Test | |
run: ctest --preset=default -j 2 | |
- name: Benchmarks | |
if: ${{ !contains(matrix.os, 'windows') }} | |
run: ${{ github.workspace }}/build/benchmarks/stronk_benchmarks | |
- name: Benchmarks-windows | |
if: ${{ contains(matrix.os, 'windows') }} | |
run: | | |
${{ github.workspace }}/build/benchmarks/Release/stronk_benchmarks |