Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"cppcheck",
"doxyfile",
"graphviz",
"libmicroros",
"mattnotmitt",
"mrad",
"multirobot",
Expand Down
98 changes: 57 additions & 41 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,34 @@
name: main

# Controls when the action will run.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

# Controls when this workflow runs.
on:
push:
# Runs on every push.
branches: [ '**' ]

release:
# A release, pre-release, or draft of a release is published.
# Runs when a release, pre-release, or draft of a release is published.
types: [ published ]
# Allows you to run this workflow manually from the Actions tab.

# Can be run manually from the Actions tab.
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
jobs:
# The introduction just shows some useful informations.
# Show some useful information.
intro:
# The type of runner that the job will run on.
runs-on: ubuntu-24.04
# Steps represent a sequence of tasks that will be executed as part of the job.

steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."

- name: Checkout repository
Comment thread
stefanvogel marked this conversation as resolved.
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.3'
cache: 'pip'
cache-dependency-path: .github/workflows/requirements.txt

- name: Install dependencies
run: |
pip install -r .github/workflows/requirements.txt

# Build all targets
# Build all targets and perform static checks on them.
build:
# The type of runner that the job will run on.
runs-on: ubuntu-24.04
needs: intro
strategy:
Expand All @@ -49,31 +40,39 @@ jobs:
"SensorFusionTarget",
"TurtleTarget"]

# Steps represent a sequence of tasks that will be executed as part of the job.
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.12.3'
cache: 'pip'
cache-dependency-path: .github/workflows/requirements.txt

- name: Install dependencies
run: |
pip install -r .github/workflows/requirements.txt

- name: Compile ${{ matrix.environment }} firmware
run: platformio run --environment ${{ matrix.environment }}

- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: |
~/.platformio/.cache
~/.platformio/packages
~/.platformio/platforms
key: ${{ runner.os }}-pio-${{ hashFiles('platformio*.ini') }}

# Run cppcheck and clang-tidy.
- name: Perform static checks on ${{ matrix.environment }}
run: platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high
run: platformio check --environment ${{ matrix.environment }} # --fail-on-defect=medium --fail-on-defect=high

# Perform static checks and test
- name: Compile ${{ matrix.environment }} firmware
run: platformio run --environment ${{ matrix.environment }}

# Perform static checks on test.
check:
# The type of runner that the job will run on.
runs-on: ubuntu-24.04
needs: intro
strategy:
Expand All @@ -85,22 +84,31 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.12.3'
cache: 'pip'
cache-dependency-path: .github/workflows/requirements.txt

- name: Install dependencies
run: |
pip install -r .github/workflows/requirements.txt

- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: |
~/.platformio/.cache
~/.platformio/packages
~/.platformio/platforms
key: ${{ runner.os }}-pio-${{ hashFiles('platformio*.ini') }}

# Run cppcheck and clang-tidy.
- name: Perform static checks on ${{ matrix.environment }}
run: platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high
run: platformio check --environment ${{ matrix.environment }} # --fail-on-defect=medium --fail-on-defect=high

# Perform tests
# Perform tests.
test:
# The type of runner that the job will run on.
runs-on: ubuntu-24.04
needs: intro

Expand All @@ -109,22 +117,30 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.12.3'
cache: 'pip'
cache-dependency-path: .github/workflows/requirements.txt

- name: Install dependencies
run: |
pip install -r .github/workflows/requirements.txt

- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: |
~/.platformio/.cache
~/.platformio/packages
~/.platformio/platforms
key: ${{ runner.os }}-pio-${{ hashFiles('platformio*.ini') }}

- name: Run tests on native environment
run: platformio test --environment Test -vvv

# Build documentation
# Build documentation.
doc:
# The type of runner that the job will run on.
runs-on: ubuntu-24.04
needs: intro
strategy:
Expand Down Expand Up @@ -157,4 +173,4 @@ jobs:

- name: Print doxygen warnings
if: ${{ failure() }}
run: cat ./doc/doxygen/doxygen_warnings.txt
run: cat ./doc/doxygen/doxygen_warnings.txt
42 changes: 40 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ lib_ignore =
${app:ConvoyLeader.lib_ignore}
extra_scripts =
${target:esp32.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Convoy leader application on simulation
Expand All @@ -299,6 +302,9 @@ lib_ignore =
${app:ConvoyLeader.lib_ignore}
extra_scripts =
${target:Sim.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Convoy follower application on target
Expand All @@ -316,6 +322,9 @@ lib_ignore =
${app:ConvoyFollower.lib_ignore}
extra_scripts =
${target:esp32.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Convoy follower application on simulation
Expand All @@ -333,6 +342,9 @@ lib_ignore =
${app:ConvoyFollower.lib_ignore}
extra_scripts =
${target:Sim.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Line follower application on simulation
Expand All @@ -350,6 +362,9 @@ lib_ignore =
${app:LineFollower.lib_ignore}
extra_scripts =
${target:Sim.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Line follower application on target
Expand All @@ -367,6 +382,9 @@ lib_ignore =
${app:LineFollower.lib_ignore}
extra_scripts =
${target:esp32.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Remote Control application on simulation
Expand All @@ -384,6 +402,9 @@ lib_ignore =
${app:RemoteControl.lib_ignore}
extra_scripts =
${target:Sim.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Remote Control application on target
Expand All @@ -401,6 +422,9 @@ lib_ignore =
${app:RemoteControl.lib_ignore}
extra_scripts =
${target:esp32.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Sensor Fusion application on simulation
Expand All @@ -420,6 +444,9 @@ lib_ignore =
extra_scripts =
${target:Sim.extra_scripts}
lib_compat_mode = off
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Sensor Fusion application on target
Expand All @@ -438,6 +465,9 @@ lib_ignore =
${app:SensorFusion.lib_ignore}
extra_scripts =
${target:esp32.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; PC target environment for tests
Expand All @@ -455,6 +485,9 @@ lib_ignore =
${app:Test.lib_ignore}
extra_scripts =
${target:Test.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Turtle application on target
Expand All @@ -475,7 +508,9 @@ lib_ignore =
libmicroros
extra_scripts =
${target:esp32.extra_scripts}

check_src_filters =
+<*>
-<lib/libmicroros/>

; *****************************************************************************
; Turtle application on simulation
Expand All @@ -498,4 +533,7 @@ lib_ignore =
${target:Sim.lib_ignore}
${app:Turtle.lib_ignore}
extra_scripts =
${target:Sim.extra_scripts}
${target:Sim.extra_scripts}
check_src_filters =
+<*>
-<lib/libmicroros/>