chore: Bump ci environment version #10
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: ci | |
on: | |
pull_request: | |
release: | |
types: [published] | |
push: | |
tags: "*" | |
branches: | |
- main | |
- develop | |
workflow_dispatch: | |
jobs: | |
Test: | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
actions: read | |
contents: write | |
security-events: write | |
strategy: | |
fail-fast: false | |
# Recommendations: | |
# * support at least 2 operating systems | |
# * support at least 2 compilers | |
# * make sure all supported configurations for your project are built | |
# | |
# Disable/enable builds in this list to meet the above recommendations | |
# and your own projects needs | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- macos-12 | |
- windows-2022 | |
compiler: | |
# you can specify the version after `-` like "llvm-13.0.0". | |
- llvm | |
- gcc-13 | |
- msvc | |
build_type: | |
- Debug | |
- Release | |
developer_mode: | |
- ON | |
- OFF | |
# To exclude a specific job from the matrix (e.g gcc on Windows), you can use this syntax. | |
exclude: | |
- os: ubuntu-22.04 | |
compiler: msvc | |
- os: macos-12 | |
compiler: msvc | |
# FIXME: Solve annotated_string mismatch in Windows to enable developer mode totally | |
- os: windows-2022 | |
compiler: msvc | |
developer_mode: ON | |
- os: windows-2022 | |
compiler: gcc-13 | |
developer_mode: ON | |
include: | |
# Inject gcov_executable variable | |
- compiler: llvm | |
gcov_executable: "llvm-cov gcov" | |
- compiler: gcc-13 | |
gcov_executable: gcov-13 | |
# Inject actual compiler name | |
- compiler: llvm | |
compiler_name: clang | |
- compiler: gcc-13 | |
compiler_name: gcc | |
- compiler: msvc | |
compiler_name: msvc | |
# Enable package for release build | |
- build_type: Release | |
developer_mode: OFF | |
package_generator: ZIP | |
steps: | |
- name: Linux - Maximize build disk space | |
uses: easimon/maximize-build-space@v10 | |
if: runner.os == 'Linux' | |
with: | |
root-reserve-mb: 30720 | |
swap-size-mb: 1024 | |
remove-android: "true" | |
remove-docker-images: "true" | |
remove-dotnet: "true" | |
- uses: actions/checkout@v4 | |
- name: Setup cache | |
uses: ./.github/actions/setup_cache | |
with: | |
compiler: ${{ matrix.compiler }} | |
build_type: ${{ matrix.build_type }} | |
developer_mode: ${{ matrix.developer_mode }} | |
- name: Setup cpp | |
uses: aminya/[email protected] | |
with: | |
compiler: ${{ matrix.compiler }} | |
vcvarsall: ${{ contains(matrix.os, 'windows')}} | |
cmake: true | |
ninja: true | |
ccache: true | |
python: true | |
cppcheck: true | |
clangtidy: true | |
gcovr: true | |
opencppcoverage: true | |
- name: Setup conan | |
uses: ./.github/actions/setup_conan | |
id: conan | |
with: | |
os: ${{ matrix.os }} | |
arch: x86_64 | |
compiler: ${{ matrix.compiler }} | |
build_type: ${{ matrix.build_type }} | |
- name: Configure cmake | |
run: | | |
cmake --preset ${{ matrix.compiler_name }} ${{ matrix.compiler_name == 'msvc' && '-A x64 -T v143' || '' }} -D ENABLE_DEVELOPER_MODE:BOOL=${{ matrix.developer_mode }} -D OPT_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} | |
- name: Build and test | |
run: | | |
conan build . ${{ steps.conan.outputs.args }} | |
- name: Unix - Coverage | |
if: runner.os != 'Windows' | |
working-directory: build/${{ matrix.compiler_name }} | |
run: | | |
ctest -C ${{ matrix.build_type }} | |
gcovr -j ${{ env.nproc }} --delete --root ../../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}' | |
- name: Windows - Coverage | |
if: runner.os == 'Windows' | |
working-directory: build/${{ matrix.compiler_name }} | |
run: | | |
OpenCppCoverage.exe --export_type cobertura:coverage.xml --cover_children -- ctest -C ${{ matrix.build_type }} | |
- name: Publish to codecov | |
uses: codecov/[email protected] | |
with: | |
files: ./build/${{ matrix.compiler_name }}/coverage.xml | |
flags: ${{ runner.os }} | |
name: ${{ runner.os }}-coverage | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
- name: CPack | |
if: matrix.package_generator != '' | |
working-directory: build/${{ matrix.compiler_name }} | |
run: | | |
cpack -C ${{ matrix.build_type }} -G ${{ matrix.package_generator }} -B _package -V | |
- name: Publish tagged | |
uses: softprops/[email protected] | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.package_generator != '' }} | |
with: | |
files: | | |
build/${{ matrix.compiler_name }}/_package/*.* |