forked from espressif/esp-protocols
- Component moved from esp-idf - Files moved to adjust to esp-protocol structure
384 lines
15 KiB
YAML
384 lines
15 KiB
YAML
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", "release-v5.0"]
|
|
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_esp_modem_usb:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest", "release-v4.4", "release-v5.0"]
|
|
example: ["modem_console", "pppos_client"]
|
|
idf_target: ["esp32s2", "esp32s3"]
|
|
|
|
runs-on: ubuntu-20.04
|
|
container: espressif/idf:${{ matrix.idf_ver }}
|
|
steps:
|
|
- name: Checkout esp-protocols
|
|
uses: actions/checkout@v3
|
|
- name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
working-directory: components/esp_modem/examples/${{ matrix.example }}
|
|
env:
|
|
IDF_TARGET: ${{ matrix.idf_target }}
|
|
shell: bash
|
|
run: |
|
|
. ${IDF_PATH}/export.sh
|
|
cat sdkconfig.ci.usb >> sdkconfig.defaults
|
|
idf.py build
|
|
|
|
build_mdns:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest"]
|
|
idf_target: ["esp32", "esp32s2", "esp32c3"]
|
|
test: [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
|
|
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.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
shell: bash
|
|
working-directory: ${{ matrix.test.path }}
|
|
run: |
|
|
${IDF_PATH}/install.sh --enable-pytest
|
|
. ${IDF_PATH}/export.sh
|
|
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
|
|
for dir in `ls -d build_*`; do
|
|
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir
|
|
zip -qur artifacts.zip $dir
|
|
done
|
|
- uses: actions/upload-artifact@v3
|
|
if: ${{ matrix.idf_target }} == "esp32"
|
|
with:
|
|
name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
path: ${{ matrix.test.path }}/artifacts.zip
|
|
if-no-files-found: error
|
|
|
|
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 }}
|
|
env:
|
|
TEST_DIR: components/asio/examples
|
|
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 }}
|
|
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
|
|
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
|
|
- name: Merge binaries with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} for ${{ matrix.example }}
|
|
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}/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@v3
|
|
with:
|
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
|
path: |
|
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/bootloader/bootloader.bin
|
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build//partition_table/partition-table.bin
|
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.bin
|
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/*.elf
|
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/flasher_args.json
|
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.h
|
|
${{ env.TEST_DIR }}/${{ matrix.example }}/build/config/sdkconfig.json
|
|
if-no-files-found: error
|
|
|
|
|
|
build_websocket:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest"]
|
|
idf_target: ["esp32"]
|
|
runs-on: ubuntu-20.04
|
|
container: espressif/idf:${{ matrix.idf_ver }}
|
|
env:
|
|
TEST_DIR: components/esp_websocket_client/examples
|
|
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: ${{ env.TEST_DIR }}
|
|
run: |
|
|
. ${IDF_PATH}/export.sh
|
|
cat sdkconfig.ci >> sdkconfig.defaults
|
|
idf.py build
|
|
- name: Merge binaries
|
|
working-directory: ${{ env.TEST_DIR }}/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@v3
|
|
with:
|
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
|
path: |
|
|
${{ env.TEST_DIR }}/build/bootloader/bootloader.bin
|
|
${{ env.TEST_DIR }}/build/partition_table/partition-table.bin
|
|
${{ env.TEST_DIR }}/build/*.bin
|
|
${{ env.TEST_DIR }}/build/*.elf
|
|
${{ env.TEST_DIR }}/build/flasher_args.json
|
|
${{ env.TEST_DIR }}/build/config/sdkconfig.h
|
|
${{ env.TEST_DIR }}/build/config/sdkconfig.json
|
|
if-no-files-found: error
|
|
|
|
build_esp_mqtt_cxx:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest", "release-v5.0"]
|
|
idf_target: ["esp32"]
|
|
test: [ { app: example, path: "components/esp_mqtt_cxx/examples" }]
|
|
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.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
shell: bash
|
|
working-directory: ${{matrix.test.path}}
|
|
run: |
|
|
${IDF_PATH}/install.sh --enable-pytest
|
|
. ${IDF_PATH}/export.sh
|
|
python $IDF_PATH/tools/ci/ci_build_apps.py . --target ${{ matrix.idf_target }} -vv --preserve-all --pytest-app
|
|
|
|
run-target-websocket:
|
|
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
|
|
env:
|
|
TEST_DIR: components/esp_websocket_client/examples
|
|
# Skip running on forks since it won't have access to secrets
|
|
if: github.repository == 'espressif/esp-protocols'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
|
path: ${{ env.TEST_DIR }}/build/
|
|
- name: Install Python packages
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
|
run: |
|
|
pip install --only-binary cryptography --extra-index-url https://dl.espressif.com/pypi/ -r $GITHUB_WORKSPACE/ci/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: ${{ env.TEST_DIR }}
|
|
run: |
|
|
python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }}
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
|
|
path: ${{ env.TEST_DIR }}/*.xml
|
|
|
|
run-target-mdns:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest"]
|
|
idf_target: ["esp32"]
|
|
test: [ { app: example, path: "components/mdns/examples" }, { app: unit_test, path: "components/mdns/tests/unit_test" } ]
|
|
name: Run mDNS target tests
|
|
needs: build_mdns
|
|
runs-on:
|
|
- self-hosted
|
|
- ESP32-ETHERNET-KIT
|
|
# Skip running on forks since it won't have access to secrets
|
|
if: github.repository == 'espressif/esp-protocols'
|
|
steps:
|
|
- name: Clear repository
|
|
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
path: ${{ matrix.test.path }}/ci/
|
|
- name: Install Python packages
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
|
run: |
|
|
sudo apt-get install -y dnsutils
|
|
- name: Run ${{ matrix.test.app }} application on ${{ matrix.idf_target }}
|
|
working-directory: ${{ matrix.test.path }}
|
|
run: |
|
|
unzip ci/artifacts.zip -d ci
|
|
for dir in `ls -d ci/build_*`; do
|
|
rm -rf build sdkconfig.defaults
|
|
mv $dir build
|
|
python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }}
|
|
done
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml
|
|
path: ${{ matrix.test.path }}/*.xml
|
|
|
|
run-target-asio:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest"]
|
|
idf_target: ["esp32"]
|
|
example: ["asio_chat", "tcp_echo_server", "udp_echo_server", "ssl_client_server"]
|
|
name: Run ASIO Example Test on target
|
|
needs: build_asio
|
|
runs-on:
|
|
- self-hosted
|
|
- ESP32-ETHERNET-KIT
|
|
env:
|
|
TEST_DIR: components/asio/examples
|
|
# Skip running on forks since it won't have access to secrets
|
|
if: github.repository == 'espressif/esp-protocols'
|
|
steps:
|
|
- name: Clear repository
|
|
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
|
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/build
|
|
- name: Install Python packages
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
|
|
run: |
|
|
sudo apt-get install -y dnsutils
|
|
- name: Download Example Test to target ${{ matrix.config }}
|
|
run: |
|
|
python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 ${{ env.TEST_DIR }}/${{ matrix.example }}/build/flash_image.bin
|
|
- name: Run Example Test ${{ matrix.example }} on target
|
|
working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }}
|
|
run: |
|
|
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@v3
|
|
if: always()
|
|
with:
|
|
name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }}
|
|
path: ${{ env.TEST_DIR }}/${{ matrix.example }}/*.xml
|
|
|
|
build_esp_modem_tests:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest"]
|
|
idf_target: ["esp32c3"]
|
|
test: [ { app: pppd, path: test/target }, { app: sim800, path: examples/pppos_client } ]
|
|
runs-on: ubuntu-20.04
|
|
container: espressif/idf:${{ matrix.idf_ver }}
|
|
env:
|
|
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
|
|
steps:
|
|
- name: Checkout esp-protocols
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Build esp-modem target tests with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
|
|
env:
|
|
IDF_TARGET: ${{ matrix.idf_target }}
|
|
SDKCONFIG: sdkconfig.ci.${{ matrix.test.app }}
|
|
shell: bash
|
|
working-directory: ${{ env.TEST_DIR }}
|
|
run: |
|
|
. ${IDF_PATH}/export.sh
|
|
rm -rf sdkconfig build
|
|
[ -f ${SDKCONFIG} ] && cp ${SDKCONFIG} sdkconfig.defaults
|
|
idf.py set-target ${{ matrix.idf_target }}
|
|
idf.py build
|
|
$GITHUB_WORKSPACE/ci/clean_build_artifacts.sh ${GITHUB_WORKSPACE}/${TEST_DIR}/build
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
path: ${{ env.TEST_DIR }}/build
|
|
if-no-files-found: error
|
|
|
|
run_esp_modem_tests:
|
|
strategy:
|
|
matrix:
|
|
idf_ver: ["latest"]
|
|
idf_target: ["esp32c3"]
|
|
test: [ { app: pppd, path: test/target }, { app: sim800, path: examples/pppos_client } ]
|
|
name: Run esp_modem Test on target
|
|
needs: build_esp_modem_tests
|
|
runs-on:
|
|
- self-hosted
|
|
- BrnoRPI-GH006
|
|
env:
|
|
TEST_DIR: components/esp_modem/${{ matrix.test.path }}
|
|
# Skip running on forks since it won't have access to secrets
|
|
if: github.repository == 'espressif/esp-protocols'
|
|
steps:
|
|
- name: Clear repository
|
|
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: modem_target_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }}
|
|
path: ${{ env.TEST_DIR }}/build
|
|
- name: Run Example Test on target
|
|
working-directory: ${{ env.TEST_DIR }}
|
|
run: |
|
|
python -m pytest --log-cli-level DEBUG --target=${{ matrix.idf_target }}
|