diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index cfcb590a7..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - build: - strategy: - matrix: - idf_ver: ["latest", "release-v4.1", "release-v4.2", "release-v4.3", "release-v4.4"] - example: ["pppos_client", "modem_console", "ap_to_pppos", "simple_cmux_client"] - idf_target: ["esp32"] - exclude: - - idf_ver: "release-v4.1" - example: modem_console - - idf_ver: "release-v4.1" - example: ap_to_pppos - - idf_ver: "release-v4.1" - example: simple_cmux_client - - idf_ver: "release-v4.2" - example: simple_cmux_client - - runs-on: ubuntu-20.04 - container: espressif/idf:${{ matrix.idf_ver }} - steps: - - name: Checkout esp-protocols - uses: actions/checkout@master - with: - path: esp-protocols - - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} - env: - IDF_TARGET: ${{ matrix.idf_target }} - shell: bash - run: | - . ${IDF_PATH}/export.sh - cd $GITHUB_WORKSPACE/esp-protocols/components/esp_modem/examples/${{ matrix.example }} - idf.py build diff --git a/.github/workflows/build_and_run_example_test_mdns.yml b/.github/workflows/build_and_run_example_test_mdns.yml deleted file mode 100644 index 3d309a6f5..000000000 --- a/.github/workflows/build_and_run_example_test_mdns.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build mDNS - -on: [push, pull_request] - -jobs: - build: - strategy: - matrix: - idf_ver: ["latest"] - idf_target: ["esp32", "esp32s2", "esp32c3"] - - runs-on: ubuntu-20.04 - container: espressif/idf:${{ matrix.idf_ver }} - steps: - - name: Checkout esp-protocols - uses: actions/checkout@v3 - with: - submodules: recursive - path: esp-protocols - - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} - env: - IDF_TARGET: ${{ matrix.idf_target }} - shell: bash - run: | - . ${IDF_PATH}/export.sh - cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/examples/ - idf.py set-target ${{ matrix.idf_target }} - cat sdkconfig.ci.eth_def >> sdkconfig.defaults - idf.py build - rm sdkconfig.defaults - cat sdkconfig.ci.eth_custom_netif >> sdkconfig.defaults - idf.py build - rm sdkconfig.defaults - cat sdkconfig.ci.eth_socket >> sdkconfig.defaults - idf.py build - cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_apps/ - idf.py set-target ${{ matrix.idf_target }} - idf.py build diff --git a/.github/workflows/build_and_run_example_test_websocket.yml b/.github/workflows/build_and_run_example_test_websocket.yml deleted file mode 100644 index cc65cc159..000000000 --- a/.github/workflows/build_and_run_example_test_websocket.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Build Websockets - -on: [push, pull_request] - -jobs: - build: - strategy: - matrix: - idf_ver: ["latest"] - idf_target: ["esp32"] - - runs-on: ubuntu-20.04 - container: espressif/idf:${{ matrix.idf_ver }} - steps: - - name: Checkout esp-protocols - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} - env: - IDF_TARGET: ${{ matrix.idf_target }} - shell: bash - working-directory: components/esp_websocket_client/examples/ - run: | - . ${IDF_PATH}/export.sh - cat sdkconfig.ci >> sdkconfig.defaults - idf.py build - - name: Merge binaries - working-directory: components/esp_websocket_client/examples/build - env: - IDF_TARGET: ${{ matrix.idf_target }} - shell: bash - run: | - . ${IDF_PATH}/export.sh - esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args - - uses: actions/upload-artifact@v2 - with: - name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }} - path: | - components/esp_websocket_client/examples/build/bootloader/bootloader.bin - components/esp_websocket_client/examples/build/partition_table/partition-table.bin - components/esp_websocket_client/examples/build/websocket_example.bin - components/esp_websocket_client/examples/build/websocket_example.elf - components/esp_websocket_client/examples/build/flasher_args.json - components/esp_websocket_client/examples/build/config/sdkconfig.h - components/esp_websocket_client/examples/build/config/sdkconfig.json - if-no-files-found: error - - run-target: - name: Run Example Test on target - needs: build - strategy: - fail-fast: false - matrix: - idf_ver: ["latest"] - idf_target: ["esp32"] - runs-on: - - self-hosted - - ESP32-ETHERNET-KIT - container: - image: python:3.7-buster - options: --privileged # Privileged mode has access to serial ports - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v2 - with: - name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }} - path: components/esp_websocket_client/examples/build/ - - name: Install Python packages - env: - PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple" - run: | - pip install -r $GITHUB_WORKSPACE/components/esp_websocket_client/examples/requirements.txt - - name: Run Example Test on target - working-directory: components/esp_websocket_client/examples - run: | - pytest --log-cli-level DEBUG --junit-xml=./test_app_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }} - - uses: actions/upload-artifact@v2 - if: always() - with: - name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }} - path: examples/*.xml diff --git a/.github/workflows/build_asio.yml b/.github/workflows/build_asio.yml deleted file mode 100644 index c8b40330a..000000000 --- a/.github/workflows/build_asio.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build ASIO - -on: [push, pull_request] - -jobs: - build: - strategy: - matrix: - idf_ver: ["latest"] - idf_target: ["esp32", "esp32s2"] - example: ["asio_chat", "async_request", "socks4", "ssl_client_server", "tcp_echo_server", "udp_echo_server"] - - runs-on: ubuntu-20.04 - container: espressif/idf:${{ matrix.idf_ver }} - steps: - - name: Checkout esp-protocols - uses: actions/checkout@v3 - with: - submodules: recursive - path: esp-protocols - - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} - env: - IDF_TARGET: ${{ matrix.idf_target }} - shell: bash - run: | - . ${IDF_PATH}/export.sh - cd $GITHUB_WORKSPACE/esp-protocols/components/asio/examples/${{ matrix.example }} - idf.py set-target ${{ matrix.idf_target }} - idf.py build diff --git a/.github/workflows/host-test.yml b/.github/workflows/host-test.yml index 387cbe768..1a25e78d1 100644 --- a/.github/workflows/host-test.yml +++ b/.github/workflows/host-test.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: host_test: - name: Build and test + name: Build and Test on Host runs-on: ubuntu-20.04 container: espressif/idf:release-v4.3 env: diff --git a/.github/workflows/target-test.yml b/.github/workflows/target-test.yml new file mode 100644 index 000000000..599927961 --- /dev/null +++ b/.github/workflows/target-test.yml @@ -0,0 +1,169 @@ +name: Build and Run Target tests + +on: [push, pull_request] + +jobs: + build_esp_modem: + strategy: + matrix: + idf_ver: ["latest", "release-v4.1", "release-v4.2", "release-v4.3", "release-v4.4"] + example: ["pppos_client", "modem_console", "ap_to_pppos", "simple_cmux_client"] + idf_target: ["esp32"] + exclude: + - idf_ver: "release-v4.1" + example: modem_console + - idf_ver: "release-v4.1" + example: ap_to_pppos + - idf_ver: "release-v4.1" + example: simple_cmux_client + - idf_ver: "release-v4.2" + example: simple_cmux_client + + runs-on: ubuntu-20.04 + container: espressif/idf:${{ matrix.idf_ver }} + steps: + - name: Checkout esp-protocols + uses: actions/checkout@master + with: + path: esp-protocols + - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} + env: + IDF_TARGET: ${{ matrix.idf_target }} + shell: bash + run: | + . ${IDF_PATH}/export.sh + cd $GITHUB_WORKSPACE/esp-protocols/components/esp_modem/examples/${{ matrix.example }} + idf.py build + + build_mdns: + strategy: + matrix: + idf_ver: ["latest"] + idf_target: ["esp32", "esp32s2", "esp32c3"] + + runs-on: ubuntu-20.04 + container: espressif/idf:${{ matrix.idf_ver }} + steps: + - name: Checkout esp-protocols + uses: actions/checkout@v3 + with: + submodules: recursive + path: esp-protocols + - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} + env: + IDF_TARGET: ${{ matrix.idf_target }} + shell: bash + run: | + . ${IDF_PATH}/export.sh + cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/examples/ + idf.py set-target ${{ matrix.idf_target }} + cat sdkconfig.ci.eth_def >> sdkconfig.defaults + idf.py build + rm sdkconfig.defaults + cat sdkconfig.ci.eth_custom_netif >> sdkconfig.defaults + idf.py build + rm sdkconfig.defaults + cat sdkconfig.ci.eth_socket >> sdkconfig.defaults + idf.py build + cd $GITHUB_WORKSPACE/esp-protocols/components/mdns/tests/test_apps/ + idf.py set-target ${{ matrix.idf_target }} + idf.py build + + build_asio: + strategy: + matrix: + idf_ver: ["latest"] + idf_target: ["esp32", "esp32s2"] + example: ["asio_chat", "async_request", "socks4", "ssl_client_server", "tcp_echo_server", "udp_echo_server"] + + runs-on: ubuntu-20.04 + container: espressif/idf:${{ matrix.idf_ver }} + steps: + - name: Checkout esp-protocols + uses: actions/checkout@v3 + with: + submodules: recursive + path: esp-protocols + - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} + env: + IDF_TARGET: ${{ matrix.idf_target }} + shell: bash + run: | + . ${IDF_PATH}/export.sh + cd $GITHUB_WORKSPACE/esp-protocols/components/asio/examples/${{ matrix.example }} + idf.py set-target ${{ matrix.idf_target }} + idf.py build + + build_websocket: + strategy: + matrix: + idf_ver: ["latest"] + idf_target: ["esp32"] + + runs-on: ubuntu-20.04 + container: espressif/idf:${{ matrix.idf_ver }} + steps: + - name: Checkout esp-protocols + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} + env: + IDF_TARGET: ${{ matrix.idf_target }} + shell: bash + working-directory: components/esp_websocket_client/examples/ + run: | + . ${IDF_PATH}/export.sh + cat sdkconfig.ci >> sdkconfig.defaults + idf.py build + - name: Merge binaries + working-directory: components/esp_websocket_client/examples/build + env: + IDF_TARGET: ${{ matrix.idf_target }} + shell: bash + run: | + . ${IDF_PATH}/export.sh + esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args + - uses: actions/upload-artifact@v2 + with: + name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }} + path: components/esp_websocket_client/examples/build/ + if-no-files-found: error + + run-target: + name: Run Websocket Example Test on target + needs: build_websocket + strategy: + fail-fast: false + matrix: + idf_ver: ["latest"] + idf_target: ["esp32"] + runs-on: + - self-hosted + - ESP32-ETHERNET-KIT + container: + image: python:3.7-buster + options: --privileged # Privileged mode has access to serial ports + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v2 + with: + name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }} + path: components/esp_websocket_client/examples/build/ + - name: Install Python packages + env: + PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple" + run: | + pip install -r $GITHUB_WORKSPACE/components/esp_websocket_client/examples/requirements.txt + - name: Download Example Test to target + run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 components/esp_websocket_client/examples/build/flash_image.bin + - name: Run Example Test on target + working-directory: components/esp_websocket_client/examples + run: | + cp sdkconfig.ci sdkconfig.defaults + pytest --log-cli-level DEBUG --junit-xml=./test_app_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }} + - uses: actions/upload-artifact@v2 + if: always() + with: + name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }} + path: examples/*.xml