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 gcovr | ||
- run: clang-format -n -Werror `find src -name '*.cpp'` | ||
- run: mkdir build | ||
- run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
- run: clang-tidy -p=build `find src -name '*.cpp'` `find src -name '*.h'` | ||
- run: cmake --build build | ||
- run: ./build/src/main --gtest_output=xml:gtest_report.xml | ||
- run: mkdir coverage | ||
- run: python3 -m gcovr --html-details coverage/coverage-details.html | ||
- run: python3 -m gcovr --cobertura cobertura-coverage-details.xml | ||
- 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 |