Skip to content

Commit

Permalink
ci: use single workflow for examples and test apps
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Sep 19, 2024
1 parent b5e30df commit 45f1b7b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 106 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Run Examples
name: Build and Run Apps

on:
schedule:
Expand All @@ -8,7 +8,7 @@ on:

jobs:
build:
name: Build Examples
name: Build Apps
strategy:
fail-fast: false
matrix:
Expand All @@ -20,28 +20,33 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build Examples
- name: Build Apps
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
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-build-apps find --config sdkconfig.ci
idf-build-apps build --ignore-warning-file .ignore_build_warnings.txt --config sdkconfig.ci --parallel-index ${{ matrix.parallel_index }}
idf-build-apps find
idf-build-apps build --parallel-index ${{ matrix.parallel_index }}
- uses: actions/upload-artifact@v4
with:
name: example_binaries_${{ matrix.idf_ver }}_${{ matrix.parallel_index }}
name: app_binaries_${{ matrix.idf_ver }}_${{ matrix.parallel_index }}
path: |
*/examples/*/build_esp*/bootloader/bootloader.bin
*/examples/*/build_esp*/partition_table/partition-table.bin
*/examples/*/build_esp*/*.bin
*/examples/*/build_esp*/flasher_args.json
*/examples/*/build_esp*/config/sdkconfig.json
*/test_apps/**/build_esp*/bootloader/bootloader.bin
*/test_apps/**/build_esp*/partition_table/partition-table.bin
*/test_apps/**/build_esp*/*.bin
*/test_apps/**/build_esp*/flasher_args.json
*/test_apps/**/build_esp*/config/sdkconfig.json
run-target:
name: Run examples on target
name: Run apps on target
if: ${{ github.repository_owner == 'espressif' }}
needs: build
strategy:
Expand All @@ -57,26 +62,22 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: example_binaries_${{ matrix.idf_ver }}_*
pattern: app_binaries_${{ matrix.idf_ver }}_*
merge-multiple: true
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
run: pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf
- name: Run examples
- name: Run apps
run: pytest --target=${{ matrix.idf_target }} -m generic --build-dir=build_${{ matrix.idf_target }} --ignore=test_app

run-ethernet-based-examples:
name: Run examples on ethernet runners
run-ethernet-based-apps:
name: Run apps on ethernet runners
if: ${{ github.repository_owner == 'espressif' }}
needs: build
strategy:
fail-fast: false
matrix:
# Some components that runs Ethernet tests are marked for IDF >= v5.0 only
# Hence, not considering IDF v4.x releases here. If we find a clean way
# to let pytest know about IDF release dependency then we may reintroduce
# the IDF v4.x in the list.
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "latest"]
idf_target: ["esp32"]
runs-on: [self-hosted, ESP32-ETHERNET-KIT]
Expand All @@ -87,11 +88,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: example_binaries_${{ matrix.idf_ver }}_*
pattern: app_binaries_${{ matrix.idf_ver }}_*
merge-multiple: true
- 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 examples
- name: Run apps
run: pytest --target=${{ matrix.idf_target }} -m ethernet --build-dir=build_${{ matrix.idf_target }} --ignore=test_app
89 changes: 0 additions & 89 deletions .github/workflows/build_and_run_test_app.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .idf_build_apps.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ check_warnings = true
# build related options
build_dir = "build_@t_@w"
parallel_count = 5
config = "sdkconfig.ci"
ignore-warning-file = ".ignore_build_warnings.txt"

0 comments on commit 45f1b7b

Please sign in to comment.