diff --git a/.github/workflows/CIValidations.yml b/.github/workflows/CIValidations.yml index cd35be3a..a4428d2c 100644 --- a/.github/workflows/CIValidations.yml +++ b/.github/workflows/CIValidations.yml @@ -6,6 +6,8 @@ name: Validations CI on: pull_request: branches: [ develop ] + push: + branches: [ feature_codecov ] permissions: contents: read @@ -77,9 +79,10 @@ jobs: cd /opt/ git clone https://github.com/mach3-software/MaCh3Tutorial.git MaCh3Validations cd MaCh3Validations + git checkout feature_codecov # delete!!!!!! mkdir build cd build - cmake ../ -DMaCh3_Branch=${{ github.head_ref }} -DMaCh3Tutorial_UNITTESTS_ENABLED=TRUE + cmake ../ -DMaCh3_Branch=${{ github.head_ref }} -DMaCh3Tutorial_UNITTESTS_ENABLED=TRUE -DMaCh3Tutorial_Coverage_ENABLED=TRUE - name: Build MaCh3 Validations run: | @@ -93,7 +96,7 @@ jobs: cd /opt/MaCh3Validations/build ${{ matrix.test_1 }} - #KS: GHA is stupi when it comes to arrays. I tried something fancy but it was crashing terribly + #KS: GHA is stupid when it comes to arrays. I tried something fancy but it was crashing terribly #If you know how to write this better please let me know # Run the second test if it is defined @@ -145,3 +148,20 @@ jobs: ${{ matrix.test_9 }} fi + - name: Install gcovr + run: | + apt-get update + apt-get install -y gcovr + + - name: Generate Coverage Report + # only need to do this for one combination of OS and compiler + working-directory: /opt/MaCh3Validations/build + run: gcovr --json -o MaCh3_coverage.json -r .. -f "../MaCh3/*" + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + verbose: true + files: MaCh3_coverage.json + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}