diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e344845..a817641 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,24 +1,24 @@ -# name: MacOS CI Test +name: MacOS CI Test -# on: -# push: -# branches: [ main, master, dev ] -# pull_request: -# branches: [ main, master, dev ] +on: + push: + branches: [ main, master, dev ] + pull_request: + branches: [ main, master, dev ] -# jobs: -# build: -# runs-on: macos-latest -# steps: -# - uses: actions/checkout@v2 -# - name: prepare -# run: | -# make prepare -# - name: configure -# run: | -# cmake -H. -Bbuild -DCMAKE_BUILD_TYPE="Debug" -# - name: building and testing -# run: | -# cmake --build build --config Debug -# cd build -# ctest . +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: prepare + run: | + make prepare + - name: configure + run: | + cmake -H. -Bbuild -DCMAKE_BUILD_TYPE="Debug" + - name: building and testing + run: | + cmake --build build --config Debug + cd build + ctest . diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 73acc64..d035f68 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,45 +1,45 @@ -# name: Ubuntu CI Test +name: Ubuntu CI Test -# on: -# push: -# branches: [ main, master, dev ] -# pull_request: -# branches: [ main, master, dev ] +on: + push: + branches: [ main, master, dev ] + pull_request: + branches: [ main, master, dev ] -# jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: install -# run: | -# pip install --user -U gcovr -# - name: prepare -# run: | -# make prepare -# - name: configure -# run: | -# cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On -# - name: building and testing -# run: | -# cmake --build build --config Debug --target coverage -j4 -# cd build -# ctest . -# - name: Code Coverage Report -# uses: irongut/CodeCoverageSummary@v1.3.0 -# with: -# filename: build/coverage/coverage.cobertura.xml -# badge: true -# fail_below_min: true -# format: markdown -# hide_branch_rate: false -# hide_complexity: true -# indicators: true -# output: both -# thresholds: '60 80' -# - name: Add Coverage PR Comment -# uses: marocchino/sticky-pull-request-comment@v2 -# if: github.event_name == 'pull_request' -# with: -# recreate: true -# path: code-coverage-results.md +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install + run: | + pip install --user -U gcovr + - name: prepare + run: | + make prepare + - name: configure + run: | + cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On + - name: building and testing + run: | + cmake --build build --config Debug --target coverage -j4 + cd build + ctest . + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: build/coverage/coverage.cobertura.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: true + indicators: true + output: both + thresholds: '60 80' + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' + with: + recreate: true + path: code-coverage-results.md diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a54b9aa..5cce786 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,24 +1,24 @@ -# name: Windows CI Test +name: Windows CI Test -# on: -# push: -# branches: [ main, master, dev ] -# pull_request: -# branches: [ main, master, dev ] +on: + push: + branches: [ main, master, dev ] + pull_request: + branches: [ main, master, dev ] -# jobs: -# build: -# runs-on: windows-latest -# steps: -# - uses: actions/checkout@v2 -# - name: prepare -# run: | -# make prepare -# - name: configure -# run: | -# cmake -H"." -Bbuild -T host=x86 -A x64 -DCMAKE_BUILD_TYPE="Debug" -# - name: building and testing -# run: | -# cmake --build build --config Debug -# cd build -# ctest . +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: prepare + run: | + make prepare + - name: configure + run: | + cmake -H"." -Bbuild -T host=x86 -A x64 -DCMAKE_BUILD_TYPE="Debug" + - name: building and testing + run: | + cmake --build build --config Debug + cd build + ctest . diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index 6eac0b4..b1bc35d 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -135,7 +135,8 @@ function(setup_target_for_coverage_gcovr_html) --json-summary --json-summary-pretty --html-theme - blue) + github.dark-green + --gcov-ignore-errors=no_working_dir_found) # ABR added since workflow `.github/workflows/ubuntu.yml` failed set(GCOVR_HTML_CMD ${GCOVR_PATH} ${GCOVR_EXTRA_FLAGS} @@ -145,10 +146,10 @@ function(setup_target_for_coverage_gcovr_html) --json-summary ${Coverage_NAME}/summary.json --json-summary-pretty - # --cobertura - # ${Coverage_NAME}/coverage.cobertura.xml - # --cobertura-pretty - # --decisions + --cobertura + ${Coverage_NAME}/coverage.cobertura.xml + --cobertura-pretty + --decisions -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS} diff --git a/notes.md b/notes.md index 93bb2db..0537fdf 100644 --- a/notes.md +++ b/notes.md @@ -85,3 +85,13 @@ - [Creating an Example Workflow](https://docs.github.com/en/actions/use-cases-and-examples/creating-an-example-workflow) - [GitHub Actions](https://github.com/actions) for automate your GitHub workflows - [Disable/Enabling workflows](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow?tool=webui) + +- **GitHub Pull Requests**: + - [Git Pull Request](https://www.geeksforgeeks.org/git-pull-request/) + - In GitLab is called Merge Request + +- **GitHub Actions** for Unit Testing and Code Coverage: + - Following workflows: + - [MAC OS](.github/workflows/macos.yml) + - [Ubuntu](.github/workflows/ubuntu.yml) + - [Windows](.github/workflows/windows.yml)