👷 add CI step for coverage

This commit is contained in:
Niels Lohmann 2021-01-31 19:38:03 +01:00
parent d6f54a0837
commit 5573533181
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69

View File

@ -120,25 +120,20 @@ jobs:
ci_test_coverage: ci_test_coverage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container: nlohmann/json-ci:latest
image: nlohmann/json-ci:latest
options: -v /__w/json/json:/workdir
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: cmake - name: cmake
run: cmake -S . -B build -DJSON_CI=On run: cmake -S . -B build -DJSON_CI=On
- name: build - name: build
run: | run: cmake --build build --target ci_test_coverage
cmake --build build --target ci_test_coverage
cp -vr /__w/json/json/build/html /workdir
cp -vr /__w/json/json/build/json.info /workdir
- name: archive coverage report - name: archive coverage report
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: code-coverage-report name: code-coverage-report
path: /__w/json/json/html path: /__w/json/json/build/html
- name: Coveralls - name: Coveralls
uses: coverallsapp/github-action@master uses: coverallsapp/github-action@master
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: /__w/json/json/json.info path-to-lcov: /__w/json/json/build/json.info