-
Notifications
You must be signed in to change notification settings - Fork 9
100 lines (91 loc) · 2.81 KB
/
test-python-package.yml
File metadata and controls
100 lines (91 loc) · 2.81 KB
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
90
91
92
93
94
95
96
97
98
99
100
name: Test Python Package
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.run_id }}
cancel-in-progress: false
on:
pull_request:
paths:
- "idf_build_apps/**"
- ".github/workflows/test-build-idf-apps.yml"
push:
branches:
- main
env:
IDF_PATH: /opt/esp/idf
defaults:
run:
shell: bash
jobs:
build-python-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- run: |
pip install -U pip
pip install flit
flit build
- name: Upload built python packages
uses: actions/upload-artifact@v7
with:
name: wheel
path: dist/idf_build_apps-*.whl
build-apps-on-idf-env:
if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'test-old-idf-releases') }}
needs: build-python-packages
strategy:
matrix:
idf-branch:
[release-v5.2, release-v5.3, release-v5.4, release-v5.5, release-v6.0]
runs-on: ubuntu-latest
container:
image: espressif/idf:${{ matrix.idf-branch }}
steps:
- name: Download wheel
uses: actions/download-artifact@v8
with:
name: wheel
- name: Build the Apps
run: |
bash $IDF_PATH/install.sh
. $IDF_PATH/export.sh
pip install idf_build_apps-*.whl
cd $IDF_PATH/examples/get-started/hello_world
echo 'CONFIG_IDF_TARGET="esp32"' >sdkconfig.defaults
idf-build-apps build --build-dir build_@t --size-file size_info.json
test -f build_esp32/hello_world.bin
test -f build_esp32/size_info.json
test ! -f build_esp32s2/hello_world.bin
build-apps-on-idf-master:
runs-on: ubuntu-latest
container:
image: espressif/idf:latest
env:
FLIT_ROOT_INSTALL: 1
steps:
- uses: actions/checkout@v6
- name: Build the Apps
run: |
bash $IDF_PATH/install.sh
. $IDF_PATH/export.sh
pip install flit
flit install -s
python -m idf_build_apps build -vv -t esp32 \
-p $IDF_PATH/examples/get-started/hello_world \
--size-file size_info.json
pytest --cov idf_build_apps --cov-report term-missing:skip-covered --junit-xml pytest.xml | tee pytest-coverage.txt
- name: Save PR number
if: github.event.number
run: echo ${{ github.event.number }} > pr_number.txt
- name: Upload test results
uses: actions/upload-artifact@v6
if: always() && github.event_name == 'pull_request'
with:
name: test-results
path: |
pr_number.txt
pytest-coverage.txt
pytest.xml
retention-days: 7