Add CoAP examples from ESP-IDF #7
Workflow file for this run
This file contains 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: Build and Run CoAP Examples | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Once per day at midnight | |
pull_request: | |
types: [opened, reopened, synchronize] | |
paths: | |
- 'coap/**' | |
jobs: | |
build: | |
name: Build CoAP Client Example | |
strategy: | |
fail-fast: false | |
matrix: | |
idf_ver: ["release-v4.4", "release-v5.0", "latest"] | |
idf_target: ["esp32"] | |
runs-on: ubuntu-20.04 | |
container: espressif/idf:${{ matrix.idf_ver }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Build CoAP Client Example | |
env: | |
IDF_TARGET: ${{ matrix.idf_target }} | |
shell: bash | |
working-directory: coap/examples/coap_client | |
run: | | |
. ${IDF_PATH}/export.sh | |
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" | |
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" | |
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" | |
idf.py set-target esp32 | |
cat sdkconfig.ci >> sdkconfig | |
idf.py build | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: coap_client_example_bin_${{ matrix.idf_ver }} | |
path: | | |
coap/examples/coap_client/build/bootloader/bootloader.bin | |
coap/examples/coap_client/build/partition_table/partition-table.bin | |
coap/examples/coap_client/build/coap_client.bin | |
coap/examples/coap_client/build/coap_client.elf | |
coap/examples/coap_client/build/flasher_args.json | |
run-target: | |
name: Run CoAP Client example on target | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
idf_ver: ["release-v4.4", "release-v5.0", "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: coap_client_example_bin_${{ matrix.idf_ver }} | |
path: coap/examples/coap_client/build | |
- name: Install Python packages | |
env: | |
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" | |
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf | |
- name: Run CoAP Client example | |
working-directory: coap/examples/coap_client | |
run: pytest --target=${{ matrix.idf_target }} |