Run PushButton Switch Unit Tests #96
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: Run PushButton Switch Unit Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
unit_tests_running: | |
name: RUN Library Unit Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
module: [pushbutton, switch] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.1 | |
with: | |
submodules: recursive | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
- name: Build binary | |
working-directory: test/${{matrix.module}} | |
run: | | |
mkdir out | |
cmake -Bout -GNinja | |
cmake --build out | |
- name: Run ${{matrix.module}} tests | |
working-directory: test/${{matrix.module}}/out | |
run: ./${{matrix.module}}_test -v | |
# - name: generate GCOV report | |
# uses: threeal/gcovr-action@main | |
# with: | |
# excludes: test | |
- name: Save Unit Tests run artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{matrix.module}}_tests_artifacts | |
path: test/${{matrix.module}}/out | |
if-no-files-found: error | |
overwrite: true | |
retention-days: 1 | |
code_coverage: | |
name: RUN Code Coverage Check | |
needs: unit_tests_running | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get pushbutton GCOV data | |
uses: actions/download-artifact@v4 | |
with: | |
name: pushbutton_tests_artifacts | |
path: ./test/pushbutton/out | |
- name: Get switch GCOV data | |
uses: actions/download-artifact@v4 | |
with: | |
name: switch_tests_artifacts | |
path: ./test/switch/out | |
- name: Run Library GCOV check | |
uses: threeal/gcovr-action@main | |
with: | |
excludes: test | |
fail-under-line: 95 | |
- name: Run Library GCOV check | |
uses: niwciu/gcovr-action@develop | |
with: | |
excludes: test | |
html-out: ./reports/library_coverage_report.html | |
html-title: PUSHBUTTON, SWITCH library GCC Code Coverage Report | |
html-theme: github.dark-green | |
- name: Upload coverage hmtl report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: ./reports | |
if-no-files-found: error | |
overwrite: true | |
retention-days: 1 | |
# Switch_test_running: | |
# name: Switch Test RUN | |
# runs-on: windows-latest | |
# # strategy: | |
# # matrix: | |
# # os: [ubuntu-latest, windows-latest] | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4.0.0 | |
# with: | |
# submodules: recursive | |
# - name: arm-none-eabi-gcc | |
# uses: ryanwinter/arm-none-eabi-gcc@master | |
# with: | |
# release: '10-2021.10' | |
# - name: Install Ninja | |
# uses: seanmiddleditch/gha-setup-ninja@v3 | |
# - name: Build binary | |
# working-directory: test/switch | |
# run: | | |
# mkdir out | |
# cmake -Bout -GNinja | |
# cmake --build out | |
# - name: Run inputs tests | |
# working-directory: test/switch/out | |
# run: ./switch_test.exe -v | |
# template_2_test_running: | |
# name: template_2 Test RUN | |
# runs-on: windows-latest | |
# # strategy: | |
# # matrix: | |
# # os: [ubuntu-latest, windows-latest] | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4.0.0 | |
# with: | |
# submodules: recursive | |
# - name: arm-none-eabi-gcc | |
# uses: ryanwinter/arm-none-eabi-gcc@master | |
# with: | |
# release: '10-2021.10' | |
# - name: Install Ninja | |
# uses: seanmiddleditch/gha-setup-ninja@v3 | |
# - name: Build binary | |
# working-directory: test/template_2 | |
# run: | | |
# mkdir out | |
# cmake -Bout -GNinja | |
# cmake --build out | |
# - name: List files | |
# working-directory: test/template_2/out | |
# run: dir | |
# - name: Run inputs tests | |
# working-directory: test/template_2/out | |
# run: ./template_2_test.exe -v |