-
Notifications
You must be signed in to change notification settings - Fork 93
89 lines (85 loc) · 3.3 KB
/
build_and_run_test_app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Build and Run Test Application
on:
schedule:
- cron: '0 0 * * *' # Once per day at midnight
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
name: Build Test App
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "latest"]
idf_target: ["esp32", "esp32c3", "esp32s3"] # @todo ESP32S2 has less RAM and the test_app will not fit
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
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 build
- uses: actions/upload-artifact@v4
with:
name: test_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
path: |
test_app/build/bootloader/bootloader.bin
test_app/build/partition_table/partition-table.bin
test_app/build/idf_extra_test_app.bin
test_app/build/idf_extra_test_app.elf
test_app/build/flasher_args.json
run-target:
name: Run Test App on target
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", "esp32c3", "esp32s3"]
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}"]
container:
image: python:3.11-bookworm
options: --privileged # Privileged mode has access to serial ports
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
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://dl.espressif.com/pypi/"
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf
- name: Run Test App on target
working-directory: test_app
run: pytest --junit-xml=./test_app_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --target=${{ matrix.idf_target }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: test_app_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
path: test_app/*.xml
publish-results:
name: Publish Test App results
needs: run-target
if: ${{ always() && github.repository_owner == 'espressif' }} # Run even if the previous step failed
runs-on: ubuntu-20.04
steps:
- name: Download Test results
uses: actions/download-artifact@v4
with:
path: test_results
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: test_results/**/*.xml