Skip to content

CI Pipeline

CI Pipeline #4

Workflow file for this run

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
runs-on: ubuntu-latest
needs: [build_unit_tets,build_STM32G070RB_modbus_master, build_STM32G070RB_modbus_slave]
steps:
- name: checkout
uses: actions/checkout@v4
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: Run Unit Tests
continue-on-error: true
run: arm-none-eabi-gcc --version # This step will fail
- name: Check Code Coverage
run: echo "test" # This step will not fail
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