@@ -13,122 +13,33 @@ jobs:
13
13
name : Build
14
14
strategy :
15
15
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" } ]
19
18
runs-on : ubuntu-20.04
20
19
container : espressif/idf:${{ matrix.idf_ver }}
21
20
steps :
22
21
- name : Checkout esp-protocols
23
22
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 }}
27
24
shell : bash
28
- working-directory : ${{ matrix.test.path }}
29
25
run : |
30
- ${IDF_PATH}/install.sh --enable-pytest
31
26
. ${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
34
34
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
35
35
zip -qur artifacts.zip $dir
36
36
done
37
37
- 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
80
38
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
90
41
if-no-files-found : error
91
42
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
-
132
43
target_tests_mdns :
133
44
# Skip running on forks since it won't have access to secrets
134
45
if : |
139
50
matrix :
140
51
idf_ver : ["latest"]
141
52
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 " } ]
143
54
needs : build_mdns
144
55
runs-on :
145
56
- self-hosted
@@ -151,14 +62,14 @@ jobs:
151
62
- uses : actions/download-artifact@v3
152
63
with :
153
64
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/
155
66
- name : Install Python packages
156
67
env :
157
68
PIP_EXTRA_INDEX_URL : " https://www.piwheels.org/simple"
158
69
run : |
159
70
sudo apt-get install -y dnsutils
160
71
- name : Run ${{ matrix.test.app }} application on ${{ matrix.idf_target }}
161
- working-directory : ${{ matrix.test.path }}
72
+ working-directory : components/mdns/ ${{ matrix.test.path }}
162
73
run : |
163
74
unzip ci/artifacts.zip -d ci
164
75
for dir in `ls -d ci/build_*`; do
170
81
if : always()
171
82
with :
172
83
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