Merge pull request #123 from rodneylab/ci__update_ci_config #173
This file contains 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: Ubuntu CI Test | |
on: | |
push: | |
branches: [main, master, dev] | |
pull_request: | |
branches: [main, master, dev] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
disable-telemetry: true | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: install | |
run: sudo apt-get update && sudo apt-get install lcov libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev freeglut3-dev libxinerama-dev libxi-dev | |
- name: Setup Cpp | |
uses: aminya/setup-cpp@d485b24c1283deafc12b4b8ae90ff09c0d1eb972 # v0.44.0 | |
with: | |
clangtidy: true | |
- name: configure | |
run: | | |
cmake -H. -Bbuild -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On | |
- name: building | |
run: | | |
cmake --build build --config Debug --target Catch_tests_run -j4 | |
- name: run unit tests | |
working-directory: ./build/bin | |
run: | | |
./Catch_tests_run | |
- name: generate coverage | |
working-directory: ./build | |
run: | | |
make cov | |
- name: Install gcovr | |
run: | | |
pip install -r requirements.txt --require-hashes | |
- name: Generate JSON coverage report | |
working-directory: ./build | |
run: | | |
gcovr -r .. . --filter ../src/ --branches --cobertura > coverage.xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |