espressif_idf-extra-components/.github/workflows/build_and_run_test_app.yml

93 lines
3.2 KiB
YAML

name: Build and Run Test Application
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
name: Build Test App
strategy:
matrix:
idf_ver: ["release-v4.3", "release-v4.4", "latest"]
idf_target: ["esp32", "esp32c3", "esp32s3"] # @todo ESP32S2 has less RAM and the test_app will not fit
exclude:
- idf_ver: "release-v4.3"
idf_target: esp32s3 # ESP32S3 support started with version 4.4
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- name: Build Test Application
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
working-directory: test_app
run: |
. ${IDF_PATH}/export.sh
idf.py build
- name: Merge binaries
working-directory: test_app/build
run: |
pip install esptool
python -m esptool --chip esp32 merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
- uses: actions/upload-artifact@v2
with:
name: test_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
path: |
test_app/build/flash_image.bin
#run-qemu: # Keeping this here for future reference. QEMU tests are not passing now
# name: Run Test App in QEMU
# needs: build
# strategy:
# matrix:
# idf_ver: ["release-v4.4", "latest"] #FIXME: QEMU is crashing with v4.3 build
# runs-on: ubuntu-20.04
# container: ageon/pytest_env
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - uses: actions/download-artifact@v2
# with:
# name: test_app_bin_esp32_${{ matrix.idf_ver }}
# path: test_app/build
# - name: Run Test App in QEMU
# working-directory: test_app
# run: pytest -s --junit-xml=./test_app_results.xml --embedded-services qemu
run-target:
name: Run Test App on target
needs: build
strategy:
matrix:
idf_ver: ["release-v4.3", "release-v4.4", "latest"]
idf_target: ["esp32", "esp32c3", "esp32s3"]
exclude:
- idf_ver: "release-v4.3"
idf_target: esp32s3 # ESP32S3 support started with version 4.4
runs-on: [self-hosted, linux, docker, esp32] # Unfortunately `${{ matrix.idf_target }}` is not accepted here
container:
image: python:3.7-slim-buster
options: --privileged
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
name: test_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
path: test_app/build
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
run: pip install esptool pytest-embedded==0.6.0rc0 pytest-embedded-serial-esp==0.6.0rc0
- name: Download Test App to target
run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 test_app/build/flash_image.bin
- name: Run Test App on target
working-directory: test_app
run: pytest -s --junit-xml=./test_app_results.xml --embedded-services esp --target=${{ matrix.idf_target }}