Skip to content

Bump codecov/codecov-action from 4 to 5 #289

Bump codecov/codecov-action from 4 to 5

Bump codecov/codecov-action from 4 to 5 #289

Workflow file for this run

name: Windows
on: [push, pull_request]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
image: [windows-2022]
compiler: ["Visual Studio", "ClangCL", "clang"]
cxx: [20, 23]
fail-fast: false
name: ${{ matrix.compiler }} (C++${{ matrix.cxx }})
runs-on: ${{ matrix.image }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install ninja
run: |
choco install ninja opencppcoverage
echo "C:/Program Files/OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Clang
if: matrix.compiler == 'clang'
uses: egor-tensin/setup-clang@v1
- name: Set up Visual Studio shell
if: matrix.compiler != 'clang'
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Configure
if: matrix.compiler == 'Visual Studio'
run: >
cmake -S .
-B build
-G "Ninja Multi-Config"
-D CMAKE_CXX_STANDARD=${{ matrix.cxx }}
-D TETL_BUILD_WERROR=ON
-D TETL_BUILD_CONTRACT_CHECKS=OFF
- name: Configure
if: matrix.compiler == 'ClangCL'
run: >
cmake -S .
-B build
-G "Visual Studio 17 2022"
-T ClangCL
-D CMAKE_CXX_STANDARD=${{ matrix.cxx }}
-D TETL_BUILD_WERROR=ON
- name: Configure
if: matrix.compiler == 'clang'
run: >
cmake -S .
-B build
-G "Ninja Multi-Config"
-D CMAKE_C_COMPILER=clang
-D CMAKE_CXX_COMPILER=clang++
-D CMAKE_CXX_STANDARD=${{ matrix.cxx }}
-D TETL_BUILD_WERROR=ON
-D TETL_BUILD_WEVERYTHING=ON
- name: Build -- Debug
run: cmake --build build --config Debug --parallel 2
- name: Test -- Debug
if: matrix.compiler != 'Visual Studio'
run: ctest --test-dir build -C Debug --output-on-failure
- name: Test -- Coverage
if: matrix.compiler == 'Visual Studio'
working-directory: ./build
run: OpenCppCoverage --export_type cobertura:coverage.xml --cover_children -- ctest -C Debug --output-on-failure
- name: Build -- Release
run: cmake --build build --config Release --parallel 2
- name: Test -- Release
run: ctest --test-dir build -C Release --output-on-failure
- uses: codecov/codecov-action@v5
if: matrix.compiler == 'Visual Studio'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.xml
fail_ci_if_error: true