Skip to content

Commit

Permalink
(ci) Codecov via GitHub Actions
Browse files Browse the repository at this point in the history
Also fix a minor security issue.
  • Loading branch information
acgetchell committed Mar 6, 2022
1 parent de9279f commit e53ed26
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [<http://contributor-covenant.org/version/1/4>][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
48 changes: 48 additions & 0 deletions .github/workflows/codecov-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CodeCov

on: [workflow_dispatch]

jobs:
codecov:
name: CodeCov
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: Setup
run: |
sudo apt update
sudo apt-get install build-essential ninja-build ccache lcov
- name: Restore artifacts, or setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: bd602277bf7fc3188b3d086b302c6840464db900

- name: Install vcpkg packages and configure CMake
shell: bash
run: |
vcpkg install --feature-flags=manifests
cmake -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -D ENABLE_TESTING:BOOL=TRUE -D ENABLE_COVERAGE:BOOL=TRUE -S . -B build
- name: Build
run: cmake --build build

- name: Generate coverage
continue-on-error: true
run: |
cd $GITHUB_WORKSPACE/build
ctest --schedule-random --rerun-failed --output-on-failure -j2
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/usr/include/*' '*/vcpkg_installed/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage to CodeCov
run: |
cd $GITHUB_WORKSPACE/build
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"

0 comments on commit e53ed26

Please sign in to comment.