diachenko-mischa is testing out GitHub Actions π #21
Workflow file for this run
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: GitHub Actions Demo | |
run-name: ${{ github.actor }} is testing out GitHub Actions π | |
on: [push] | |
jobs: | |
Linter: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: 'pip' # caching pip dependencies | |
- run: | | |
pip install -r requirements.txt | |
clang-format -n -Werror `find src -name '*.cpp'` | |
mkdir build | |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
clang-tidy -p=build `find src -name '*.cpp'` `find src -name '*.h'` | |
cmake --build build | |
./build/src/main --gtest_output=xml:gtest_report.xml | |
mkdir coverage | |
python3 -m gcovr --cobertura cobertura-coverage-details.xml | |
python3 -m gcovr --html-details coverage/coverage-details.html | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() # always run even if the previous step fails | |
with: | |
report_paths: 'gtest_report.xml' | |
- name: Code Coverage Report | |
uses: irongut/[email protected] | |
with: | |
filename: cobertura-coverage-details.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '60 80' | |
- uses: actions/upload-artifact@v3 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: gtest_report | |
path: gtest_report.xml | |
- uses: actions/upload-artifact@v3 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: coverage | |
path: coverage/ | |
- uses: actions/upload-artifact@v3 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: cobertura-coverage-details | |
path: cobertura-coverage-details.xml |