@@ -62,48 +62,30 @@ jobs:
62
62
matrix :
63
63
idf_ver : ["latest"]
64
64
idf_target : ["esp32", "esp32s2", "esp32c3"]
65
- config : ["eth_custom_netif", "eth_def", "eth_no_ipv6", "eth_socket" ]
65
+ test : [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
66
66
runs-on : ubuntu-20.04
67
67
container : espressif/idf:${{ matrix.idf_ver }}
68
- env :
69
- TEST_DIR : components/mdns/examples
70
68
steps :
71
69
- name : Checkout esp-protocols
72
70
uses : actions/checkout@v3
73
71
with :
74
72
submodules : recursive
75
- - name : Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} for ${{ matrix.config }}
76
- env :
77
- IDF_TARGET : ${{ matrix.idf_target }}
73
+ - name : Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
78
74
shell : bash
79
- working-directory : ${{ env.TEST_DIR }}
75
+ working-directory : ${{ matrix.test.path }}
80
76
run : |
77
+ ${IDF_PATH}/install.sh --enable-pytest
81
78
. ${IDF_PATH}/export.sh
82
- rm -rf sdkconfig sdkconfig.defaults build build_${{ matrix.config }}
83
- cat sdkconfig.ci.${{ matrix.config }} >> sdkconfig.defaults
84
- idf.py set-target ${{ matrix.idf_target }}
85
- idf.py build
86
- mv build build_${{ matrix.config }}
87
- - name : Merge binaries with IDF-${{ matrix.idf_ver }} for ${{ matrix.config }}
88
- working-directory : ${{ env.TEST_DIR }}
89
- env :
90
- IDF_TARGET : ${{ matrix.idf_target }}
91
- shell : bash
92
- run : |
93
- . ${IDF_PATH}/export.sh
94
- cd build_${{ matrix.config }}
95
- esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
79
+ python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
80
+ for dir in `ls -d build_*`; do
81
+ $GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
82
+ zip -qur artifacts.zip $dir
83
+ done
96
84
- uses : actions/upload-artifact@v3
85
+ if : ${{ matrix.idf_target }} == "esp32"
97
86
with :
98
- name : examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}
99
- path : |
100
- ${{ env.TEST_DIR }}/build_${{ matrix.config }}/bootloader/bootloader.bin
101
- ${{ env.TEST_DIR }}/build_${{ matrix.config }}/partition_table/partition-table.bin
102
- ${{ env.TEST_DIR }}/build_${{ matrix.config }}/*.bin
103
- ${{ env.TEST_DIR }}/build_${{ matrix.config }}/*.elf
104
- ${{ env.TEST_DIR }}/build_${{ matrix.config }}/flasher_args.json
105
- ${{ env.TEST_DIR }}/build_${{ matrix.config }}/config/sdkconfig.h
106
- ${{ env.TEST_DIR }}/build_${{ matrix.config }}/config/sdkconfig.json
87
+ name : mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
88
+ path : ${{ matrix.test.path }}/artifacts.zip
107
89
if-no-files-found : error
108
90
109
91
build_asio :
@@ -240,14 +222,12 @@ jobs:
240
222
matrix :
241
223
idf_ver : ["latest"]
242
224
idf_target : ["esp32"]
243
- config : ["eth_custom_netif", "eth_def", "eth_no_ipv6", "eth_socket" ]
244
- name : Run mDNS Example Test on target
225
+ test : [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
226
+ name : Run mDNS target tests
245
227
needs : build_mdns
246
228
runs-on :
247
229
- self-hosted
248
230
- ESP32-ETHERNET-KIT
249
- env :
250
- TEST_DIR : components/mdns/examples
251
231
# Skip running on forks since it won't have access to secrets
252
232
if : github.repository == 'espressif/esp-protocols'
253
233
steps :
@@ -256,28 +236,27 @@ jobs:
256
236
- uses : actions/checkout@v3
257
237
- uses : actions/download-artifact@v3
258
238
with :
259
- name : examples_app_bin_ ${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}
260
- path : ${{ env.TEST_DIR }}/build_${{ matrix.config }}
239
+ name : mdns_bin_ ${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
240
+ path : ${{ matrix.test.path }}/ci/
261
241
- name : Install Python packages
262
242
env :
263
243
PIP_EXTRA_INDEX_URL : " https://www.piwheels.org/simple"
264
244
run : |
265
245
sudo apt-get install -y dnsutils
266
- - name : Download Example Test to target ${{ matrix.config }}
267
- run : |
268
- python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/mdns/examples/build_${{ matrix.config }}/flash_image.bin
269
- - name : Run Example Test on target ${{ matrix.config }}
270
- working-directory : components/mdns/examples
246
+ - name : Run ${{ matrix.test.app }} application on ${{ matrix.idf_target }}
247
+ working-directory : ${{ matrix.test.path }}
271
248
run : |
249
+ unzip ci/artifacts.zip -d ci
250
+ for dir in `ls -d ci/build_*`; do
272
251
rm -rf build sdkconfig.defaults
273
- mv build_${{ matrix.config }} build
274
- cat sdkconfig.ci. ${{ matrix.config }} >> sdkconfig.defaults
275
- python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}.xml --target=${{ matrix.idf_target }}
252
+ mv $dir build
253
+ python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_ ${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }}
254
+ done
276
255
- uses : actions/upload-artifact@v3
277
256
if : always()
278
257
with :
279
- name : examples_results_ ${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}
280
- path : ${{ env.TEST_DIR }}/*.xml
258
+ name : results_ ${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml
259
+ path : ${{ matrix.test.path }}/*.xml
281
260
282
261
run-target-asio :
283
262
strategy :
@@ -348,7 +327,6 @@ jobs:
348
327
idf.py set-target ${{ matrix.idf_target }}
349
328
idf.py build
350
329
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh ${GITHUB_WORKSPACE}/${TEST_DIR}/build
351
- ls build
352
330
- uses : actions/upload-artifact@v3
353
331
with :
354
332
name : modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
0 commit comments