Merge pull request #1137 from david-cermak/fix/mdns_browse_sync_end_race #4479
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "asio: build/target-tests" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| jobs: | |
| build_asio: | |
| if: contains(github.event.pull_request.labels.*.name, 'asio') || github.event_name == 'push' | |
| name: Build | |
| strategy: | |
| matrix: | |
| idf_ver: ["latest", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "release-v6.0"] | |
| idf_target: ["esp32", "esp32s2"] | |
| example: ["asio_chat", "async_request", "socks4", "ssl_client_server", "tcp_echo_server", "udp_echo_server", "unit", "build_test"] | |
| exclude: | |
| # build_test (regression test for PR 2403) runs only on latest, v6.0 and v5.5 | |
| - { idf_ver: "release-v5.1", example: "build_test" } | |
| - { idf_ver: "release-v5.2", example: "build_test" } | |
| - { idf_ver: "release-v5.3", example: "build_test" } | |
| - { idf_ver: "release-v5.4", example: "build_test" } | |
| runs-on: ubuntu-22.04 | |
| container: espressif/idf:${{ matrix.idf_ver }} | |
| env: | |
| APP_DIR: ${{ (matrix.example == 'unit' || matrix.example == 'build_test') && format('components/asio/tests/{0}', matrix.example) || format('components/asio/examples/{0}', matrix.example) }} | |
| steps: | |
| - name: Checkout esp-protocols | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} | |
| working-directory: ${{ env.APP_DIR }} | |
| env: | |
| IDF_TARGET: ${{ matrix.idf_target }} | |
| shell: bash | |
| run: | | |
| . ${IDF_PATH}/export.sh | |
| test -f sdkconfig.ci && cat sdkconfig.ci >> sdkconfig.defaults || echo "No sdkconfig.ci" | |
| idf.py set-target ${{ matrix.idf_target }} | |
| idf.py build | |
| $GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/build | |
| zip -qur artifacts.zip build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }} | |
| path: ${{ env.APP_DIR }}/artifacts.zip | |
| if-no-files-found: error | |
| target_tests_asio: | |
| # Skip running on forks since it won't have access to secrets | |
| if: | | |
| github.repository == 'espressif/esp-protocols' && | |
| ( contains(github.event.pull_request.labels.*.name, 'asio') || github.event_name == 'push' ) | |
| name: Target tests | |
| strategy: | |
| matrix: | |
| idf_ver: ["latest", "release-v5.3", "release-v5.4", "release-v5.5", "release-v6.0"] | |
| idf_target: ["esp32"] | |
| example: ["asio_chat", "tcp_echo_server", "udp_echo_server", "ssl_client_server", "unit"] | |
| needs: build_asio | |
| runs-on: | |
| - self-hosted | |
| - ESP32-ETHERNET-KIT | |
| env: | |
| APP_DIR: ${{ matrix.example == 'unit' && 'components/asio/tests/unit' || format('components/asio/examples/{0}', matrix.example) }} | |
| steps: | |
| - name: Clear repository | |
| run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }} | |
| path: ${{ env.APP_DIR }} | |
| - name: Run Example Test ${{ matrix.example }} on target | |
| working-directory: ${{ env.APP_DIR }} | |
| run: | | |
| export PYENV_ROOT="$HOME/.pyenv" | |
| export PATH="$PYENV_ROOT/bin:$PATH" | |
| eval "$(pyenv init --path)" | |
| eval "$(pyenv init -)" | |
| if ! pyenv versions --bare | grep -q '^3\.12\.6$'; then | |
| echo "Installing Python 3.12.6..." | |
| pyenv install -s 3.12.6 | |
| fi | |
| if ! pyenv virtualenvs --bare | grep -q '^myenv$'; then | |
| echo "Creating pyenv virtualenv 'myenv'..." | |
| pyenv virtualenv 3.12.6 myenv | |
| fi | |
| pyenv activate myenv | |
| python --version | |
| unzip artifacts.zip -d . | |
| python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}.xml --target=${{ matrix.idf_target }} | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }} | |
| path: ${{ env.APP_DIR }}/*.xml |