1
- name : main
2
-
3
- # Controls when the action will run.
4
- on :
5
- push :
6
- branches : [ '**' ]
7
- pull_request :
8
- branches : [ main ]
9
- release :
10
- # A release, pre-release, or draft of a release is published.
11
- types : [ published ]
12
- # Allows you to run this workflow manually from the Actions tab.
13
- workflow_dispatch :
14
-
15
- # A workflow run is made up of one or more jobs that can run sequentially or in parallel.
16
- jobs :
17
- # The introduction just shows some useful informations.
18
- intro :
19
- # The type of runner that the job will run on.
20
- runs-on : ubuntu-latest
21
- # Steps represent a sequence of tasks that will be executed as part of the job.
22
- steps :
23
- - run : echo "The job was automatically triggered by a ${{ github.event_name }} event."
24
- - run : echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
25
-
26
- # Build all targets
27
- build :
28
- # The type of runner that the job will run on.
29
- runs-on : ubuntu-latest
30
- needs : intro
31
- strategy :
32
- matrix :
33
- environment : ["CalibTarget", "ConvoyFollowerTarget", "ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "SensorFusionTarget"]
34
-
35
- # Steps represent a sequence of tasks that will be executed as part of the job.
36
- steps :
37
- - name : Checkout repository
38
- uses : actions/checkout@v4
39
-
40
- - name : Cache pip
41
- uses : actions/cache@v4
42
- with :
43
- path : ~/.cache/pip
44
- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
45
- restore-keys : |
46
- ${{ runner.os }}-pip-
47
-
48
- - name : Cache PlatformIO
49
- uses : actions/cache@v4
50
- with :
51
- path : ~/.platformio
52
- key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
53
-
54
- - name : Set up Python
55
- uses : actions/setup-python@v5
56
- with :
57
- python-version : ' 3.9'
58
-
59
- - name : Install PlatformIO
60
- run : |
61
- python -m pip install --upgrade pip
62
- pip install --upgrade platformio
63
-
64
- - name : Compile ${{ matrix.environment }} firmware
65
- run : platformio run --environment ${{ matrix.environment }}
66
-
67
- # Perform static checks and test
68
- check :
69
- # The type of runner that the job will run on.
70
- runs-on : ubuntu-latest
71
- needs : intro
72
- strategy :
73
- matrix :
74
- environment : ["CalibTarget", "ConvoyFollowerTarget", "ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "SensorFusionTarget", "TestSim"]
75
-
76
- steps :
77
- - name : Checkout repository
78
- uses : actions/checkout@v4
79
-
80
- - name : Cache pip
81
- uses : actions/cache@v4
82
- with :
83
- path : ~/.cache/pip
84
- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
85
- restore-keys : |
86
- ${{ runner.os }}-pip-
87
-
88
- - name : Cache PlatformIO
89
- uses : actions/cache@v4
90
- with :
91
- path : ~/.platformio
92
- key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
93
-
94
- - name : Set up Python
95
- uses : actions/setup-python@v5
96
- with :
97
- python-version : ' 3.9'
98
-
99
- - name : Install PlatformIO
100
- run : |
101
- python -m pip install --upgrade pip
102
- pip install --upgrade platformio
103
-
104
- - name : Perform static checks on ${{ matrix.environment }}
105
- run : platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high
106
-
107
- # Perform tests
108
- test :
109
- # The type of runner that the job will run on.
110
- runs-on : ubuntu-latest
111
- needs : intro
112
-
113
- steps :
114
- - name : Checkout repository
115
- uses : actions/checkout@v4
116
-
117
- - name : Cache pip
118
- uses : actions/cache@v4
119
- with :
120
- path : ~/.cache/pip
121
- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
122
- restore-keys : |
123
- ${{ runner.os }}-pip-
124
-
125
- - name : Cache PlatformIO
126
- uses : actions/cache@v4
127
- with :
128
- path : ~/.platformio
129
- key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
130
-
131
- - name : Set up Python
132
- uses : actions/setup-python@v5
133
- with :
134
- python-version : ' 3.9'
135
-
136
- - name : Install PlatformIO
137
- run : |
138
- python -m pip install --upgrade pip
139
- pip install --upgrade platformio
140
-
141
- - name : Run tests on native environment
142
- run : platformio test --environment TestSim -vvv
143
-
144
- # Build documentation
145
- doc :
146
- # The type of runner that the job will run on.
147
- runs-on : ubuntu-latest
148
- needs : intro
149
- strategy :
150
- matrix :
151
- environment : ["CalibTarget", "ConvoyFollowerTarget", "ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "SensorFusionTarget", "CalibSim", "ConvoyFollowerSim", "ConvoyLeaderSim", "LineFollowerSim", "RemoteControlSim", "SensorFusionSim"]
152
-
153
- steps :
154
- - name : Checkout repository
155
- uses : actions/checkout@v4
156
-
157
- - name : Cache pip
158
- uses : actions/cache@v4
159
- with :
160
- path : ~/.cache/pip
161
- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
162
- restore-keys : |
163
- ${{ runner.os }}-pip-
164
-
165
- - name : Cache PlatformIO
166
- uses : actions/cache@v4
167
- with :
168
- path : ~/.platformio
169
- key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
170
-
171
- - name : Set up Python
172
- uses : actions/setup-python@v5
173
- with :
174
- python-version : ' 3.9'
175
-
176
- - name : Install PlatformIO
177
- run : |
178
- python -m pip install --upgrade pip
179
- pip install --upgrade platformio
180
-
181
- - name : Set up graphviz
182
- uses : ts-graphviz/setup-graphviz@v2
183
-
184
- - name : Set up doxygen and generate documentation for ${{ matrix.environment }}
185
- uses : mattnotmitt/doxygen-action@v1.9.5
186
- with :
187
- working-directory : ' ./doc/doxygen'
188
- doxyfile-path : ' ./${{ matrix.environment }}Doxyfile'
189
-
190
- - name : Print doxygen warnings
191
- if : ${{ failure() }}
1
+ name : main
2
+
3
+ # Controls when the action will run.
4
+ on :
5
+ push :
6
+ branches : [ '**' ]
7
+ pull_request :
8
+ branches : [ main ]
9
+ release :
10
+ # A release, pre-release, or draft of a release is published.
11
+ types : [ published ]
12
+ # Allows you to run this workflow manually from the Actions tab.
13
+ workflow_dispatch :
14
+
15
+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel.
16
+ jobs :
17
+ # The introduction just shows some useful informations.
18
+ intro :
19
+ # The type of runner that the job will run on.
20
+ runs-on : ubuntu-latest
21
+ # Steps represent a sequence of tasks that will be executed as part of the job.
22
+ steps :
23
+ - run : echo "The job was automatically triggered by a ${{ github.event_name }} event."
24
+ - run : echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}."
25
+
26
+ # Build all targets
27
+ build :
28
+ # The type of runner that the job will run on.
29
+ runs-on : ubuntu-latest
30
+ needs : intro
31
+ strategy :
32
+ matrix :
33
+ environment : ["CalibTarget", "ConvoyFollowerTarget", "ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "SensorFusionTarget"]
34
+
35
+ # Steps represent a sequence of tasks that will be executed as part of the job.
36
+ steps :
37
+ - name : Checkout repository
38
+ uses : actions/checkout@v4
39
+
40
+ - name : Cache pip
41
+ uses : actions/cache@v4
42
+ with :
43
+ path : ~/.cache/pip
44
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
45
+ restore-keys : |
46
+ ${{ runner.os }}-pip-
47
+
48
+ - name : Cache PlatformIO
49
+ uses : actions/cache@v4
50
+ with :
51
+ path : ~/.platformio
52
+ key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
53
+
54
+ - name : Set up Python
55
+ uses : actions/setup-python@v5
56
+ with :
57
+ python-version : ' 3.9'
58
+
59
+ - name : Install PlatformIO
60
+ run : |
61
+ python -m pip install --upgrade pip
62
+ pip install --upgrade platformio
63
+
64
+ - name : Compile ${{ matrix.environment }} firmware
65
+ run : platformio run --environment ${{ matrix.environment }}
66
+
67
+ # Perform static checks and test
68
+ check :
69
+ # The type of runner that the job will run on.
70
+ runs-on : ubuntu-latest
71
+ needs : intro
72
+ strategy :
73
+ matrix :
74
+ environment : ["CalibTarget", "ConvoyFollowerTarget", "ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "SensorFusionTarget", "TestSim"]
75
+
76
+ steps :
77
+ - name : Checkout repository
78
+ uses : actions/checkout@v4
79
+
80
+ - name : Cache pip
81
+ uses : actions/cache@v4
82
+ with :
83
+ path : ~/.cache/pip
84
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
85
+ restore-keys : |
86
+ ${{ runner.os }}-pip-
87
+
88
+ - name : Cache PlatformIO
89
+ uses : actions/cache@v4
90
+ with :
91
+ path : ~/.platformio
92
+ key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
93
+
94
+ - name : Set up Python
95
+ uses : actions/setup-python@v5
96
+ with :
97
+ python-version : ' 3.9'
98
+
99
+ - name : Install PlatformIO
100
+ run : |
101
+ python -m pip install --upgrade pip
102
+ pip install --upgrade platformio
103
+
104
+ - name : Perform static checks on ${{ matrix.environment }}
105
+ run : platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high
106
+
107
+ # Perform tests
108
+ test :
109
+ # The type of runner that the job will run on.
110
+ runs-on : ubuntu-latest
111
+ needs : intro
112
+
113
+ steps :
114
+ - name : Checkout repository
115
+ uses : actions/checkout@v4
116
+
117
+ - name : Cache pip
118
+ uses : actions/cache@v4
119
+ with :
120
+ path : ~/.cache/pip
121
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
122
+ restore-keys : |
123
+ ${{ runner.os }}-pip-
124
+
125
+ - name : Cache PlatformIO
126
+ uses : actions/cache@v4
127
+ with :
128
+ path : ~/.platformio
129
+ key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
130
+
131
+ - name : Set up Python
132
+ uses : actions/setup-python@v5
133
+ with :
134
+ python-version : ' 3.9'
135
+
136
+ - name : Install PlatformIO
137
+ run : |
138
+ python -m pip install --upgrade pip
139
+ pip install --upgrade platformio
140
+
141
+ - name : Run tests on native environment
142
+ run : platformio test --environment TestSim -vvv
143
+
144
+ # Build documentation
145
+ doc :
146
+ # The type of runner that the job will run on.
147
+ runs-on : ubuntu-latest
148
+ needs : intro
149
+ strategy :
150
+ matrix :
151
+ environment : ["CalibTarget", "ConvoyFollowerTarget", "ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "SensorFusionTarget", "CalibSim", "ConvoyFollowerSim", "ConvoyLeaderSim", "LineFollowerSim", "RemoteControlSim", "SensorFusionSim"]
152
+
153
+ steps :
154
+ - name : Checkout repository
155
+ uses : actions/checkout@v4
156
+
157
+ - name : Cache pip
158
+ uses : actions/cache@v4
159
+ with :
160
+ path : ~/.cache/pip
161
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
162
+ restore-keys : |
163
+ ${{ runner.os }}-pip-
164
+
165
+ - name : Cache PlatformIO
166
+ uses : actions/cache@v4
167
+ with :
168
+ path : ~/.platformio
169
+ key : ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
170
+
171
+ - name : Set up Python
172
+ uses : actions/setup-python@v5
173
+ with :
174
+ python-version : ' 3.9'
175
+
176
+ - name : Install PlatformIO
177
+ run : |
178
+ python -m pip install --upgrade pip
179
+ pip install --upgrade platformio
180
+
181
+ - name : Set up graphviz
182
+ uses : ts-graphviz/setup-graphviz@v2
183
+
184
+ - name : Set up doxygen and generate documentation for ${{ matrix.environment }}
185
+ uses : mattnotmitt/doxygen-action@v1.9.5
186
+ with :
187
+ working-directory : ' ./doc/doxygen'
188
+ doxyfile-path : ' ./${{ matrix.environment }}Doxyfile'
189
+
190
+ - name : Print doxygen warnings
191
+ if : ${{ failure() }}
192
192
run : cat ./doc/doxygen/doxygen_warnings.txt
0 commit comments