-
Notifications
You must be signed in to change notification settings - Fork 633
211 lines (183 loc) · 8.79 KB
/
localhost_demo_runner.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Localhost Server Demo Runner
on:
push:
branches: ["**"]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build-and-run-localhost-demos:
name: Build and Run Localhost Server Demos
runs-on: ubuntu-20.04
steps:
- name: Clone This Repo
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Python3
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install libmosquitto
id: install-libmosquitto
run: sudo apt-get install -y libmosquitto-dev
- name: Install CMake
id: install-cmake
uses: lukka/[email protected]
with:
cmakeVersion: 3.2.0
- name: Generate SSL credentials
id: generate-credentials
uses: FreeRTOS/CI-CD-GitHub-Actions/ssl-credential-creator@main
- name: Start localhost MQTT broker
id: mqtt-broker
if: success() || failure() && steps.generate-credentials.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/localhost-mqtt-broker@main
with:
root-ca-cert-path: ${{ steps.generate-credentials.outputs.root-ca-cert-path }}
server-priv-key-path: ${{ steps.generate-credentials.outputs.server-priv-key-path }}
server-cert-path: ${{ steps.generate-credentials.outputs.server-cert-path }}
- name: Start localhost HTTP server
id: http-server
if: success() || failure() && steps.generate-credentials.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/localhost-http-1.1-server@main
with:
root-ca-cert-path: ${{ steps.generate-credentials.outputs.root-ca-cert-path }}
server-priv-key-path: ${{ steps.generate-credentials.outputs.server-priv-key-path }}
server-cert-path: ${{ steps.generate-credentials.outputs.server-cert-path }}
- name: Configure CMake Build for Localhost servers
id: configure-cmake-build
if: success() || failure() && steps.install-cmake.outcome == 'success' && steps.install-libmosquitto.outcome == 'success'
run: |
mkdir build && cd build
cmake .. \
-G "Unix Makefiles" \
-DBUILD_DEMOS=1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS='-Wall -Wextra -Werror' \
-DAWS_IOT_ENDPOINT="localhost" \
-DBROKER_ENDPOINT="localhost" \
-DCLIENT_CERT_PATH=${{ steps.generate-credentials.outputs.device-cert-path }} \
-DROOT_CA_CERT_PATH=${{ steps.generate-credentials.outputs.root-ca-cert-path }} \
-DCLIENT_PRIVATE_KEY_PATH=${{ steps.generate-credentials.outputs.device-priv-key-path }} \
-DCLIENT_IDENTIFIER="test" \
-DTHING_NAME="thing-name" \
-DS3_PRESIGNED_GET_URL="get-url" \
-DS3_PRESIGNED_PUT_URL="put-url" \
-DCLAIM_CERT_PATH="cert/path" \
-DCLAIM_PRIVATE_KEY_PATH="key/path" \
-DPROVISIONING_TEMPLATE_NAME="template-name" \
-DDEVICE_SERIAL_NUMBER="00000" \
-DCSR_SUBJECT_NAME="CN=Fleet Provisioning Demo" \
-DGREENGRASS_ADDRESS="greengrass-address"
- name: Configure the HTTP Basic TLS Demo
id: configure-http-basic-tls
if: success() || failure() && steps.configure-cmake-build.outcome == 'success'
working-directory: demos/http/http_demo_basic_tls
run: sed -i 's/define HTTPS_PORT[[:blank:]]\{1,\}443/define HTTPS_PORT ( 4443 )/g' demo_config.h
shell: bash
- name: Build the HTTP Basic TLS Demo
id: build-http-basic-tls
if: success() || failure() && steps.configure-http-basic-tls.outcome == 'success'
run: cd build && make http_demo_basic_tls
- name: Run and monitor the HTTP Basic TLS Demo
if: success() || failure() && steps.build-http-basic-tls.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
with:
exe-path: ./build/bin/http_demo_basic_tls
log-dir: demo_run_logs
timeout-seconds: 300
success-line: "Demo completed successfully."
- name: Configure the HTTP Mutual Auth Demo
id: configure-http-mutual-auth
if: success() || failure() && steps.configure-cmake-build.outcome == 'success'
working-directory: demos/http/http_demo_mutual_auth
run: sed -i 's/define AWS_HTTPS_PORT[[:blank:]]\{1,\}443/define AWS_HTTPS_PORT ( 4443 )/g' demo_config.h
shell: bash
- name: Build the HTTP Mutual Auth Demo
id: build-http-mutual-auth
if: success() || failure() && steps.configure-http-mutual-auth.outcome == 'success'
run: cd build && make http_demo_mutual_auth
- name: Run and monitor the HTTP Mutual Auth Demo
if: success() || failure() && steps.build-http-mutual-auth.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
with:
exe-path: ./build/bin/http_demo_mutual_auth
log-dir: demo_run_logs
timeout-seconds: 300
success-line: "Demo completed successfully."
- name: Configure the HTTP Plaintext Demo
id: configure-http-plaintext
if: success() || failure() && steps.configure-cmake-build.outcome == 'success'
working-directory: demos/http/http_demo_plaintext
run: sed -i 's/define HTTP_PORT[[:blank:]]\{1,\}( 80 )/define HTTP_PORT ( 8080 )/g' demo_config.h
shell: bash
- name: Build the HTTP Plaintext Demo
id: build-http-plaintext
if: success() || failure() && steps.configure-http-plaintext.outcome == 'success'
run: cd build && make http_demo_plaintext
- name: Run and monitor the HTTP Plaintext Demo
if: success() || failure() && steps.build-http-plaintext.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
with:
exe-path: ./build/bin/http_demo_plaintext
log-dir: demo_run_logs
timeout-seconds: 300
success-line: "Demo completed successfully."
- name: Build the MQTT Basic TLS Demo
id: build-mqtt-basic-tls
if: success() || failure() && steps.configure-cmake-build.outcome == 'success'
run: cd build && make mqtt_demo_basic_tls
- name: Run and monitor the MQTT Basic TLS Demo
if: success() || failure() && steps.build-mqtt-basic-tls.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
with:
exe-path: ./build/bin/mqtt_demo_basic_tls
log-dir: demo_run_logs
timeout-seconds: 300
success-line: "Demo completed successfully."
- name: Build the MQTT Plaintext Demo
id: build-mqtt-plaintext-demo
if: success() || failure() && steps.configure-cmake-build.outcome == 'success'
run: cd build && make mqtt_demo_plaintext
- name: Run and monitor the MQTT Plaintext Demo
if: success() || failure() && steps.build-mqtt-plaintext-demo.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
with:
exe-path: ./build/bin/mqtt_demo_plaintext
log-dir: demo_run_logs
timeout-seconds: 300
success-line: "Demo completed successfully."
- name: Build the MQTT Serializer Demo
id: build-mqtt-serializer-demo
if: success() || failure() && steps.configure-cmake-build.outcome == 'success'
run: cd build && make mqtt_demo_serializer
- name: Run MQTT Serializer Demo
if: success() || failure() && steps.build-mqtt-serializer-demo.outcome == 'success'
run: ./build/bin/mqtt_demo_serializer
- name: Run and monitor the MQTT Serializer Demo
if: success() || failure() && steps.build-mqtt-serializer-demo.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
with:
exe-path: ./build/bin/mqtt_demo_serializer
log-dir: demo_run_logs
timeout-seconds: 300
success-line: "Demo completed successfully."
- name: Build the MQTT Subscription Manager Demo
id: build-mqtt-subscription-manager-demo
if: success() || failure() && steps.configure-cmake-build.outcome == 'success'
run: cd build && make mqtt_demo_subscription_manager
- name: Run and monitor the MQTT Subscription Manager Demo
if: success() || failure() && steps.build-mqtt-subscription-manager-demo.outcome == 'success'
uses: FreeRTOS/CI-CD-GitHub-Actions/executable-monitor@main
with:
exe-path: ./build/bin/mqtt_demo_subscription_manager
log-dir: demo_run_logs
timeout-seconds: 300
success-line: "Demo completed successfully."
- name: 'Upload demo logs'
if: always()
uses: actions/upload-artifact@v3
with:
name: demo_run_logs
path: demo_run_logs