reorganize the github workflows, #1
Workflow file for this run
This file contains hidden or 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: Coverage Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - v* | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: "1" | |
| jobs: | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| std: ["14", "17", "20", "23"] | |
| precompile: ["ON", "OFF"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get LCov | |
| run: | | |
| sudo apt-get install ca-certificates lcov | |
| #wget https://github.com/linux-test-project/lcov/releases/download/v1.16/lcov-1.16.tar.gz | |
| #tar -xzf lcov-1.16.tar.gz | |
| #cd lcov-1.16 | |
| #sudo make install | |
| - name: Configure | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_CXX_STANDARD=${{matrix.std}} \ | |
| -DCLI11_SINGLE_FILE_TESTS=OFF \ | |
| -DCLI11_BUILD_EXAMPLES=OFF \ | |
| -DCLI11_PRECOMPILED=${{matrix.precompile}} \ | |
| -DCMAKE_BUILD_TYPE=Coverage \ | |
| -DCLI11_ENABLE_EXTRA_VALIDATORS=ON | |
| - name: Build | |
| run: cmake --build build -j4 | |
| - name: Test | |
| run: cmake --build build --target CLI11_coverage | |
| - name: Prepare coverage | |
| run: | | |
| lcov --ignore-errors gcov,mismatch --directory . --capture --output-file coverage.info | |
| lcov --remove coverage.info '*/tests/*' '/usr/*' --output-file coverage.info | |
| lcov --list coverage.info | |
| working-directory: build | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| files: build/coverage.info |