Skip to content

Commit

Permalink
wip: unify test app job, merge and publish junit results
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Sep 20, 2024
1 parent 45f1b7b commit 7375c24
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 29 deletions.
70 changes: 42 additions & 28 deletions .github/workflows/build_and_run_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ jobs:
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "latest"]
idf_ver:
# - "release-v5.0"
# - "release-v5.1"
# - "release-v5.2"
# - "release-v5.3"
- "latest"
parallel_index: [1,2,3,4,5] # This must from 1 to 'parallel_count' defined in .idf_build_apps.toml
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
Expand Down Expand Up @@ -52,9 +57,22 @@ jobs:
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "latest"]
idf_target: ["esp32"]
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}"]
idf_ver:
- "release-v5.0"
- "release-v5.1"
- "release-v5.2"
- "release-v5.3"
- "latest"
runner:
- runs-on: "esp32"
marker: "generic"
target: "esp32"
# - runs-on: "ESP32-ETHERNET-KIT"
# marker: "ethernet"
# target: "esp32"
env:
TEST_RESULT_FILE: test_results_${{ matrix.runner_target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}.xml
runs-on: [self-hosted, linux, docker, "${{ matrix.runner.tag }}"]
container:
image: python:3.11-bookworm
options: --privileged # Privileged mode has access to serial ports
Expand All @@ -69,30 +87,26 @@ jobs:
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 apps
run: pytest --target=${{ matrix.idf_target }} -m generic --build-dir=build_${{ matrix.idf_target }} --ignore=test_app
run: pytest --junit-xml=${{ env.TEST_RESULT_FILE }} --target=${{ matrix.runner.target }} -m ${{ matrix.runner.marker }} --build-dir=build_${{ matrix.runner.target }} --ignore=test_app
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test_results_${{ matrix.idf_ver }}_${{ matrix.runner.target }}
path: ${{ env.TEST_RESULT_FILE }}

run-ethernet-based-apps:
name: Run apps on ethernet runners
if: ${{ github.repository_owner == 'espressif' }}
needs: build
strategy:
fail-fast: false
matrix:
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]
container:
image: python:3.11-bookworm
options: --privileged # Privileged mode has access to serial ports
publish-results:
name: Publish Test results
needs:
- run-target
if: ${{ always() && github.repository_owner == 'espressif' }} # Run even if the previous step failed
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Download Test results
uses: actions/download-artifact@v4
with:
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 apps
run: pytest --target=${{ matrix.idf_target }} -m ethernet --build-dir=build_${{ matrix.idf_target }} --ignore=test_app
pattern: test_results_*.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: test_results/**/*.xml
2 changes: 1 addition & 1 deletion .idf_build_apps.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
target = "all"
target = "esp32" # TEMPORARY
paths = "."
recursive = true
exclude = [
Expand Down

0 comments on commit 7375c24

Please sign in to comment.