@@ -13,122 +13,33 @@ jobs:
1313 name : Build
1414 strategy :
1515 matrix :
16- idf_ver : ["latest"]
17- idf_target : ["esp32", "esp32s2", "esp32c3"]
18- test : [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
16+ idf_ver : ["latest", "release-v5.0"]
17+ test : [ { app: example, path: "examples" }, { app: unit_test, path: "tests/unit_test" }, { app: test_app, path: "tests/test_apps" } ]
1918 runs-on : ubuntu-20.04
2019 container : espressif/idf:${{ matrix.idf_ver }}
2120 steps :
2221 - name : Checkout esp-protocols
2322 uses : actions/checkout@v3
24- with :
25- submodules : recursive
26- - name : Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
23+ - name : Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
2724 shell : bash
28- working-directory : ${{ matrix.test.path }}
2925 run : |
30- ${IDF_PATH}/install.sh --enable-pytest
3126 . ${IDF_PATH}/export.sh
32- python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
33- for dir in `ls -d build_*`; do
27+ python -m pip install idf-build-apps
28+ # Build default configs for all targets
29+ python ./ci/build_apps.py components/mdns/${{ matrix.test.path }} -r default -m components/mdns/.build-test-rules.yml -d
30+ # Build specific configs for test targets
31+ python ./ci/build_apps.py components/mdns/${{ matrix.test.path }}
32+ cd components/mdns/${{ matrix.test.path }}
33+ for dir in `ls -d build_esp32_*`; do
3434 $GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
3535 zip -qur artifacts.zip $dir
3636 done
3737 - uses : actions/upload-artifact@v3
38- if : ${{ matrix.idf_target }} == "esp32"
39- with :
40- name : mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
41- path : ${{ matrix.test.path }}/artifacts.zip
42- if-no-files-found : error
43-
44- build_mdns_app :
45- if : contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push'
46- name : Build Test Apps
47- strategy :
48- matrix :
49- idf_ver : ["latest"]
50- idf_target : ["esp32", "esp32s2", "esp32c3"]
51- runs-on : ubuntu-20.04
52- container : espressif/idf:${{ matrix.idf_ver }}
53- steps :
54- - name : Checkout esp-protocols
55- uses : actions/checkout@v3
56- with :
57- submodules : recursive
58- - name : Setup Build Environment
59- working-directory : components/mdns/tests/test_apps
60- run : |
61- . ${IDF_PATH}/export.sh
62- pip install -r $GITHUB_WORKSPACE/ci/requirements.txt
63- - name : Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
64- env :
65- IDF_TARGET : ${{ matrix.idf_target }}
66- shell : bash
67- working-directory : components/mdns/tests/test_apps
68- run : |
69- . ${IDF_PATH}/export.sh
70- python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --pytest-apps
71- - name : Merge binaries with IDF-${{ matrix.idf_ver }}
72- working-directory : components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default
73- env :
74- IDF_TARGET : ${{ matrix.idf_target }}
75- shell : bash
76- run : |
77- . ${IDF_PATH}/export.sh
78- esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
79- - uses : actions/upload-artifact@v2
8038 with :
81- name : examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
82- path : |
83- components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/bootloader/bootloader.bin
84- components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/partition_table/partition-table.bin
85- components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/*.bin
86- components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/*.elf
87- components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/flasher_args.json
88- components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/config/sdkconfig.h
89- components/mdns/tests/test_apps/build_${{ matrix.idf_target }}_default/config/sdkconfig.json
39+ name : mdns_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }}
40+ path : components/mdns/${{ matrix.test.path }}/artifacts.zip
9041 if-no-files-found : error
9142
92- target_test_apps_mdns :
93- # Skip running on forks since it won't have access to secrets
94- if : |
95- github.repository == 'espressif/esp-protocols' &&
96- ( contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push' )
97- name : Target Test Apps
98- strategy :
99- matrix :
100- idf_ver : ["latest"]
101- idf_target : ["esp32"]
102- needs : build_mdns_app
103- runs-on :
104- - self-hosted
105- - ESP32-ETHERNET-KIT
106- steps :
107- - name : Clear repository
108- run : sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
109- - uses : actions/checkout@v3
110- - uses : actions/download-artifact@v2
111- with :
112- name : examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
113- path : components/mdns/tests/test_apps/build
114- - name : Install Python packages
115- env :
116- PIP_EXTRA_INDEX_URL : " https://www.piwheels.org/simple"
117- run : |
118- sudo apt-get install -y dnsutils
119- - name : Download Test apps to target
120- run : |
121- python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/mdns/tests/test_apps/build/flash_image.bin
122- - name : Run Example Test on target
123- working-directory : components/mdns/tests/test_apps
124- run : |
125- python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{matrix.idf_target}}
126- - uses : actions/upload-artifact@v2
127- if : always()
128- with :
129- name : test_apps_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
130- path : components/mdns/tests/test_apps/*.xml
131-
13243 target_tests_mdns :
13344 # Skip running on forks since it won't have access to secrets
13445 if : |
13950 matrix :
14051 idf_ver : ["latest"]
14152 idf_target : ["esp32"]
142- test : [ { app: example, path: "components/mdns/ examples" }, { app: unit_test, path: "components/mdns/ tests/unit_test" } ]
53+ test : [ { app: example, path: "examples" }, { app: unit_test, path: "tests/unit_test" }, { app: test_app, path: "tests/test_apps " } ]
14354 needs : build_mdns
14455 runs-on :
14556 - self-hosted
@@ -151,14 +62,14 @@ jobs:
15162 - uses : actions/download-artifact@v3
15263 with :
15364 name : mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
154- path : ${{ matrix.test.path }}/ci/
65+ path : components/mdns/ ${{ matrix.test.path }}/ci/
15566 - name : Install Python packages
15667 env :
15768 PIP_EXTRA_INDEX_URL : " https://www.piwheels.org/simple"
15869 run : |
15970 sudo apt-get install -y dnsutils
16071 - name : Run ${{ matrix.test.app }} application on ${{ matrix.idf_target }}
161- working-directory : ${{ matrix.test.path }}
72+ working-directory : components/mdns/ ${{ matrix.test.path }}
16273 run : |
16374 unzip ci/artifacts.zip -d ci
16475 for dir in `ls -d ci/build_*`; do
17081 if : always()
17182 with :
17283 name : results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml
173- path : ${{ matrix.test.path }}/*.xml
84+ path : components/mdns/ ${{ matrix.test.path }}/*.xml
0 commit comments