CI Pipeline #10
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: CI Pipeline | |
on: | |
workflow_dispatch: | |
# push: | |
jobs: | |
build_unit_tets: | |
name: Build Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Get Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Build | |
working-directory: test/modbus | |
run: | | |
mkdir out | |
cmake -Bout -GNinja | |
cmake --build out | |
- name: Save Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: modbus_unit_tests_app | |
path: ./test/modbus/out | |
if-no-files-found: warn | |
retention-days: 1 | |
overwrite: true | |
build_STM32G070RB_modbus_master: | |
name: Build STM32G070RB ModBus Master | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc) | |
uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
- name: Get Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Build | |
working-directory: examples/STM32G070RB_MODBUS_MASTER | |
run: | | |
mkdir out | |
cmake -Bout -GNinja -DCMAKE_BUILD_TYPE=Debug | |
cmake --build out | |
build_STM32G070RB_modbus_slave: | |
name: Build STM32G070RB ModBus Slave | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc) | |
uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
- name: Get Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Build | |
working-directory: examples/STM32G070RB_MODBUS_SLAVE | |
run: | | |
mkdir out | |
cmake -Bout -GNinja -DCMAKE_BUILD_TYPE=Debug | |
cmake --build out | |
run_clang-format_check: | |
name: Run Clang-format Check | |
strategy: | |
matrix: | |
path: | |
- 'src' | |
- 'test' | |
runs-on: ubuntu-latest | |
needs: [build_unit_tets,build_STM32G070RB_modbus_master, build_STM32G070RB_modbus_slave] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Run clang-format style check for C/C++/Protobuf programs. | |
uses: jidicula/[email protected] | |
with: | |
clang-format-version: '18' | |
check-path: ${{matrix.path}} | |
run_unit_tests: | |
name: Run Unit Tests | |
runs-on: ubuntu-latest | |
needs: [build_unit_tets,build_STM32G070RB_modbus_master, build_STM32G070RB_modbus_slave] | |
steps: | |
- name: Download Unit Tests Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: modbus_unit_tests_app | |
- name: Run Unit Tests | |
run: | | |
chmod +x modbus_test | |
./modbus_test -v | |
run_code_coverage_check: | |
name: Run Code Coverage Check | |
runs-on: ubuntu-latest | |
needs: [build_unit_tets,build_STM32G070RB_modbus_master, build_STM32G070RB_modbus_slave] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Download Unit Tests Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: modbus_unit_tests_app | |
path: test/modbus/out | |
- name: Run Unit Tests | |
continue-on-error: true | |
working-directory: test/modbus/out | |
run: | | |
chmod +x modbus_test | |
./modbus_test -v | |
- name: Check Test Coverage | |
uses: threeal/[email protected] | |
with: | |
fail-under-line: 90 | |
run_cppcheck: | |
name: Run CppCheck | |
runs-on: ubuntu-latest | |
needs: [build_unit_tets,build_STM32G070RB_modbus_master, build_STM32G070RB_modbus_slave] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
run_code_complexity_check: | |
name: Run Code Complexity Check | |
runs-on: ubuntu-latest | |
needs: [build_unit_tets,build_STM32G070RB_modbus_master, build_STM32G070RB_modbus_slave] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
generate_code_coverage_report: | |
name: Generate Code Coverage Report | |
runs-on: ubuntu-latest | |
needs: | |
- run_clang-format_check | |
- run_unit_tests | |
- run_code_coverage_check | |
- run_cppcheck | |
- run_code_complexity_check | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
generate_code_complexity_report: | |
name: Generate Code Complexity Report | |
runs-on: ubuntu-latest | |
needs: | |
- run_clang-format_check | |
- run_unit_tests | |
- run_code_coverage_check | |
- run_cppcheck | |
- run_code_complexity_check | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 |