|
9 | 9 |
|
10 | 10 | jobs:
|
11 | 11 | build_mosq:
|
12 |
| - if: contains(github.event.pull_request.labels.*.name, 'Comp::mosq') || github.event_name == 'push' |
13 |
| - name: Build |
| 12 | + if: contains(github.event.pull_request.labels.*.name, 'mosquitto') || github.event_name == 'push' |
| 13 | + name: Mosquitto build |
14 | 14 | strategy:
|
15 | 15 | matrix:
|
16 | 16 | idf_ver: ["latest", "release-v5.3"]
|
17 | 17 | runs-on: ubuntu-22.04
|
18 | 18 | container: espressif/idf:${{ matrix.idf_ver }}
|
| 19 | + env: |
| 20 | + TEST_DIR: components/mosquitto/examples/broker |
| 21 | + TARGET_TEST_DIR: build_esp32_default |
19 | 22 | steps:
|
20 | 23 | - name: Checkout esp-protocols
|
21 | 24 | uses: actions/checkout@v4
|
|
28 | 31 | run: |
|
29 | 32 | . ${IDF_PATH}/export.sh
|
30 | 33 | pip install idf-component-manager idf-build-apps --upgrade
|
31 |
| - python ci/build_apps.py components/mosquitto/examples/ -c |
| 34 | + python ci/build_apps.py ${TEST_DIR} |
| 35 | + cd ${TEST_DIR} |
| 36 | + ${GITHUB_WORKSPACE}/ci/clean_build_artifacts.sh `pwd`/${TARGET_TEST_DIR} |
| 37 | + zip -qur artifacts.zip ${TARGET_TEST_DIR} |
| 38 | + - uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: mosq_target_esp32_${{ matrix.idf_ver }} |
| 41 | + path: ${{ env.TEST_DIR }}/artifacts.zip |
| 42 | + if-no-files-found: error |
| 43 | + |
| 44 | + test_mosq: |
| 45 | + # Skip running on forks since it won't have access to secrets |
| 46 | + if: | |
| 47 | + github.repository == 'espressif/esp-protocols' && |
| 48 | + ( contains(github.event.pull_request.labels.*.name, 'mosquitto') || github.event_name == 'push' ) |
| 49 | + name: Mosquitto target test |
| 50 | + needs: build_mosq |
| 51 | + strategy: |
| 52 | + matrix: |
| 53 | + idf_ver: ["latest", "release-v5.3"] |
| 54 | + runs-on: |
| 55 | + - self-hosted |
| 56 | + - ESP32-ETHERNET-KIT |
| 57 | + env: |
| 58 | + TEST_DIR: components/mosquitto/examples/broker |
| 59 | + TARGET_TEST_DIR: build_esp32_default |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + - uses: actions/download-artifact@v4 |
| 63 | + with: |
| 64 | + name: mosq_target_esp32_${{ matrix.idf_ver }} |
| 65 | + path: ${{ env.TEST_DIR }}/ci/ |
| 66 | + - name: Run Test |
| 67 | + working-directory: ${{ env.TEST_DIR }} |
| 68 | + run: | |
| 69 | + unzip ci/artifacts.zip -d ci |
| 70 | + for dir in `ls -d ci/build_*`; do |
| 71 | + rm -rf build sdkconfig.defaults |
| 72 | + mv $dir build |
| 73 | + python -m pytest --log-cli-level DEBUG --junit-xml=./results_esp32_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=esp32 |
| 74 | + done |
0 commit comments