|
| 1 | +name: Build ESP-BSP apps |
| 2 | + |
| 3 | +# This job builds all examples and test_applications in this repo |
| 4 | +# Applications are selected for build based on changes files and dependencies defined in .build-test-rules.yml |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + types: [opened, reopened, synchronize] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + include: |
| 15 | + - idf_ver: "latest" |
| 16 | + parallel_count: 5 |
| 17 | + parallel_index: 1 |
| 18 | + - idf_ver: "latest" |
| 19 | + parallel_count: 5 |
| 20 | + parallel_index: 2 |
| 21 | + - idf_ver: "latest" |
| 22 | + parallel_count: 5 |
| 23 | + parallel_index: 3 |
| 24 | + - idf_ver: "latest" |
| 25 | + parallel_count: 5 |
| 26 | + parallel_index: 4 |
| 27 | + - idf_ver: "latest" |
| 28 | + parallel_count: 5 |
| 29 | + parallel_index: 5 |
| 30 | + - idf_ver: "release-v5.1" |
| 31 | + parallel_count: 2 |
| 32 | + parallel_index: 1 |
| 33 | + - idf_ver: "release-v5.1" |
| 34 | + parallel_count: 2 |
| 35 | + parallel_index: 2 |
| 36 | + - idf_ver: "release-v5.2" |
| 37 | + parallel_count: 2 |
| 38 | + parallel_index: 1 |
| 39 | + - idf_ver: "release-v5.2" |
| 40 | + parallel_count: 2 |
| 41 | + parallel_index: 2 |
| 42 | + - idf_ver: "release-v5.3" |
| 43 | + parallel_count: 2 |
| 44 | + parallel_index: 1 |
| 45 | + - idf_ver: "release-v5.3" |
| 46 | + parallel_count: 2 |
| 47 | + parallel_index: 2 |
| 48 | + - idf_ver: "release-v5.4" |
| 49 | + parallel_count: 2 |
| 50 | + parallel_index: 1 |
| 51 | + - idf_ver: "release-v5.4" |
| 52 | + parallel_count: 2 |
| 53 | + parallel_index: 2 |
| 54 | + runs-on: ubuntu-latest |
| 55 | + container: espressif/idf:${{ matrix.idf_ver }} |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Get changed files |
| 60 | + id: changed-files |
| 61 | + uses: tj-actions/changed-files@v45 |
| 62 | + with: |
| 63 | + separator: ';' # idf-build-apps expects files seprated with semicolon |
| 64 | + |
| 65 | + - name: Build ESP-BSP applications |
| 66 | + shell: bash |
| 67 | + env: |
| 68 | + IDF_EXTRA_ACTIONS_PATH: "${{ github.workspace }}/examples" |
| 69 | + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_modified_files }} |
| 70 | + run: | |
| 71 | + . ${IDF_PATH}/export.sh |
| 72 | + pip install idf-component-manager==1.* ruamel.yaml idf-build-apps==2.4.3 --upgrade |
| 73 | +
|
| 74 | + echo "Files changed: ${ALL_CHANGED_FILES}" |
| 75 | + idf-build-apps find --modified-files "${ALL_CHANGED_FILES}" |
| 76 | + idf-build-apps build --parallel-count ${{ matrix.parallel_count }} --parallel-index ${{ matrix.parallel_index }} --modified-files "${ALL_CHANGED_FILES}" --collect-app-info build_info_${{ matrix.idf_ver }}_${{ matrix.parallel_index }}.json |
| 77 | +
|
| 78 | + - uses: actions/upload-artifact@v4 |
| 79 | + if: github.repository_owner == 'espressif' && needs.prepare.outputs.build_only == '0' |
| 80 | + with: |
| 81 | + name: app_binaries_${{ matrix.idf_ver }}_${{ matrix.parallel_index }} |
| 82 | + path: | |
| 83 | + examples/*/build_*/bootloader/bootloader.bin |
| 84 | + examples/*/build_*/partition_table/partition-table.bin |
| 85 | + examples/*/build_*/*.bin |
| 86 | + examples/*/build_*/flasher_args.json |
| 87 | + examples/*/build_*/config/sdkconfig.json |
| 88 | + build_info*.json |
| 89 | +
|
| 90 | + run-target: |
| 91 | + name: Run apps |
| 92 | + if: github.repository_owner == 'espressif' && needs.prepare.outputs.build_only != '1' |
| 93 | + needs: build |
| 94 | + strategy: |
| 95 | + fail-fast: false |
| 96 | + max-parallel: 5 |
| 97 | + matrix: |
| 98 | + idf_ver: |
| 99 | + - "latest" |
| 100 | + runner: |
| 101 | + - runs-on: "esp-box-3" |
| 102 | + marker: "esp_box_3" |
| 103 | + target: "esp32s3" |
| 104 | + - runs-on: "esp32_c3_lcdkit" |
| 105 | + marker: "esp32_c3_lcdkit" |
| 106 | + target: "esp32c3" |
| 107 | + - runs-on: "esp32_p4_box" |
| 108 | + marker: "esp32_p4_box" |
| 109 | + target: "esp32p4" |
| 110 | + - runs-on: "esp32_p4_function_ev_board" |
| 111 | + marker: "esp32_p4_function_ev_board" |
| 112 | + target: "esp32p4" |
| 113 | + - runs-on: "esp32_s3_eye" |
| 114 | + marker: "esp32_s3_eye" |
| 115 | + target: "esp32s3" |
| 116 | + - runs-on: "esp32_s3_lcd_ev_board" |
| 117 | + marker: "esp32_s3_lcd_ev_board" |
| 118 | + target: "esp32s3" |
| 119 | + - runs-on: "esp32_s3_lcd_ev_board" |
| 120 | + marker: "esp32_s3_lcd_ev_board_2" |
| 121 | + target: "esp32s3" |
| 122 | + - runs-on: "esp32_s3_usb_otg" |
| 123 | + marker: "esp32_s3_usb_otg" |
| 124 | + target: "esp32s3" |
| 125 | + - runs-on: "esp_wrover_kit" |
| 126 | + marker: "esp_wrover_kit" |
| 127 | + target: "esp32" |
| 128 | + - runs-on: "m5dial" |
| 129 | + marker: "m5dial" |
| 130 | + target: "esp32s3" |
| 131 | + - runs-on: "m5stack_core" |
| 132 | + marker: "m5stack_core" |
| 133 | + target: "esp32" |
| 134 | + - runs-on: "m5stack_core_2" |
| 135 | + marker: "m5stack_core_2" |
| 136 | + target: "esp32" |
| 137 | + - runs-on: "m5stack_core_s3" |
| 138 | + marker: "m5stack_core_s3" |
| 139 | + target: "esp32s3" |
| 140 | + - runs-on: "m5stack_core_s3" |
| 141 | + marker: "m5stack_core_s3_se" |
| 142 | + target: "esp32s3" |
| 143 | + - runs-on: "esp32_azure_iot_kit" |
| 144 | + marker: "esp32_azure_iot_kit" |
| 145 | + target: "esp32" |
| 146 | + env: |
| 147 | + TEST_RESULT_NAME: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }} |
| 148 | + TEST_RESULT_FILE: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}.xml |
| 149 | + runs-on: [self-hosted, Linux, bspwall] |
| 150 | + container: |
| 151 | + image: python:3.11-bookworm |
| 152 | + options: --privileged -v /dev/boards:/dev/boards/ # Privileged mode has access to serial ports |
| 153 | + steps: |
| 154 | + - uses: actions/checkout@v4 |
| 155 | + - uses: actions/download-artifact@v4 |
| 156 | + with: |
| 157 | + pattern: app_binaries_${{ matrix.idf_ver }}_* |
| 158 | + merge-multiple: true |
| 159 | + - name: Install Python packages |
| 160 | + env: |
| 161 | + PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" |
| 162 | + run: pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pytest-custom_exit_code |
| 163 | + - name: Run apps |
| 164 | + run: | |
| 165 | + pytest --suppress-no-test-exit-code --ignore-glob '*/managed_components/*' --ignore=.github --junit-xml=${{ env.TEST_RESULT_FILE }} --target=${{ matrix.runner.target }} -m ${{ matrix.runner.marker }} --build-dir=build_${{ matrix.runner.runs-on }} |
| 166 | + - name: Upload test results |
| 167 | + uses: actions/upload-artifact@v4 |
| 168 | + if: always() |
| 169 | + with: |
| 170 | + name: ${{ env.TEST_RESULT_NAME }} |
| 171 | + path: ${{ env.TEST_RESULT_FILE }} |
| 172 | + |
| 173 | + publish-results: |
| 174 | + name: Publish Test results |
| 175 | + needs: |
| 176 | + - run-target |
| 177 | + if: github.repository_owner == 'espressif' && always() && github.event_name == 'pull_request' && needs.prepare.outputs.build_only == '0' |
| 178 | + runs-on: ubuntu-22.04 |
| 179 | + steps: |
| 180 | + - name: Download Test results |
| 181 | + uses: actions/download-artifact@v4 |
| 182 | + with: |
| 183 | + pattern: test_results_* |
| 184 | + path: test_results |
| 185 | + - name: Publish Test Results |
| 186 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 187 | + with: |
| 188 | + files: test_results/**/*.xml |
0 commit comments