11name : main
22
3- # Controls when the action will run.
3+ concurrency :
4+ group : ci-${{ github.ref }}
5+ cancel-in-progress : true
6+
7+ # Controls when this workflow runs.
48on :
59 push :
10+ # Runs on every push.
611 branches : [ '**' ]
12+
713 release :
8- # A release, pre-release, or draft of a release is published.
14+ # Runs when a release, pre-release, or draft of a release is published.
915 types : [ published ]
10- # Allows you to run this workflow manually from the Actions tab.
16+
17+ # Can be run manually from the Actions tab.
1118 workflow_dispatch :
1219
1320# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
1421jobs :
15- # The introduction just shows some useful informations .
22+ # Show some useful information .
1623 intro :
17- # The type of runner that the job will run on.
1824 runs-on : ubuntu-24.04
19- # Steps represent a sequence of tasks that will be executed as part of the job.
25+
2026 steps :
2127 - run : echo "The job was automatically triggered by a ${{ github.event_name }} event."
2228 - run : echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
2329
24- - name : Checkout repository
25- uses : actions/checkout@v4
26-
27- - name : Set up Python
28- uses : actions/setup-python@v5
29- with :
30- python-version : ' 3.12.3'
31- cache : ' pip'
32- cache-dependency-path : .github/workflows/requirements.txt
33-
34- - name : Install dependencies
35- run : |
36- pip install -r .github/workflows/requirements.txt
37-
38- # Build all targets
30+ # Build all targets and perform static checks on them.
3931 build :
40- # The type of runner that the job will run on.
4132 runs-on : ubuntu-24.04
4233 needs : intro
4334 strategy :
@@ -49,31 +40,39 @@ jobs:
4940 " SensorFusionTarget" ,
5041 " TurtleTarget" ]
5142
52- # Steps represent a sequence of tasks that will be executed as part of the job.
5343 steps :
5444 - name : Checkout repository
5545 uses : actions/checkout@v4
5646
5747 - name : Set up Python
58- uses : actions/setup-python@v5
48+ uses : actions/setup-python@v6
5949 with :
6050 python-version : ' 3.12.3'
6151 cache : ' pip'
6252 cache-dependency-path : .github/workflows/requirements.txt
63-
53+
6454 - name : Install dependencies
6555 run : |
6656 pip install -r .github/workflows/requirements.txt
67-
68- - name : Compile ${{ matrix.environment }} firmware
69- run : platformio run --environment ${{ matrix.environment }}
7057
58+ - name : Cache PlatformIO
59+ uses : actions/cache@v4
60+ with :
61+ path : |
62+ ~/.platformio/.cache
63+ ~/.platformio/packages
64+ ~/.platformio/platforms
65+ key : ${{ runner.os }}-pio-${{ hashFiles('platformio*.ini') }}
66+
67+ # Run cppcheck and clang-tidy.
7168 - name : Perform static checks on ${{ matrix.environment }}
72- run : platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high
69+ run : platformio check --environment ${{ matrix.environment }} # --fail-on-defect=medium --fail-on-defect=high
7370
74- # Perform static checks and test
71+ - name : Compile ${{ matrix.environment }} firmware
72+ run : platformio run --environment ${{ matrix.environment }}
73+
74+ # Perform static checks on test.
7575 check :
76- # The type of runner that the job will run on.
7776 runs-on : ubuntu-24.04
7877 needs : intro
7978 strategy :
@@ -85,22 +84,31 @@ jobs:
8584 uses : actions/checkout@v4
8685
8786 - name : Set up Python
88- uses : actions/setup-python@v5
87+ uses : actions/setup-python@v6
8988 with :
9089 python-version : ' 3.12.3'
9190 cache : ' pip'
9291 cache-dependency-path : .github/workflows/requirements.txt
93-
92+
9493 - name : Install dependencies
9594 run : |
9695 pip install -r .github/workflows/requirements.txt
9796
97+ - name : Cache PlatformIO
98+ uses : actions/cache@v4
99+ with :
100+ path : |
101+ ~/.platformio/.cache
102+ ~/.platformio/packages
103+ ~/.platformio/platforms
104+ key : ${{ runner.os }}-pio-${{ hashFiles('platformio*.ini') }}
105+
106+ # Run cppcheck and clang-tidy.
98107 - name : Perform static checks on ${{ matrix.environment }}
99- run : platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high
108+ run : platformio check --environment ${{ matrix.environment }} # --fail-on-defect=medium --fail-on-defect=high
100109
101- # Perform tests
110+ # Perform tests.
102111 test :
103- # The type of runner that the job will run on.
104112 runs-on : ubuntu-24.04
105113 needs : intro
106114
@@ -109,22 +117,30 @@ jobs:
109117 uses : actions/checkout@v4
110118
111119 - name : Set up Python
112- uses : actions/setup-python@v5
120+ uses : actions/setup-python@v6
113121 with :
114122 python-version : ' 3.12.3'
115123 cache : ' pip'
116124 cache-dependency-path : .github/workflows/requirements.txt
117-
125+
118126 - name : Install dependencies
119127 run : |
120128 pip install -r .github/workflows/requirements.txt
121129
130+ - name : Cache PlatformIO
131+ uses : actions/cache@v4
132+ with :
133+ path : |
134+ ~/.platformio/.cache
135+ ~/.platformio/packages
136+ ~/.platformio/platforms
137+ key : ${{ runner.os }}-pio-${{ hashFiles('platformio*.ini') }}
138+
122139 - name : Run tests on native environment
123140 run : platformio test --environment Test -vvv
124141
125- # Build documentation
142+ # Build documentation.
126143 doc :
127- # The type of runner that the job will run on.
128144 runs-on : ubuntu-24.04
129145 needs : intro
130146 strategy :
@@ -157,4 +173,4 @@ jobs:
157173
158174 - name : Print doxygen warnings
159175 if : ${{ failure() }}
160- run : cat ./doc/doxygen/doxygen_warnings.txt
176+ run : cat ./doc/doxygen/doxygen_warnings.txt
0 commit comments