-
Notifications
You must be signed in to change notification settings - Fork 36
122 lines (114 loc) · 4.18 KB
/
test-python.yml
File metadata and controls
122 lines (114 loc) · 4.18 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Target Tests
on:
pull_request:
paths:
- "**.py"
- "*/pyproject.toml"
- .github/workflows/test-python.yml
- "!docs/**"
# cancel jobs if new commit pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
jobs:
test-qemu:
timeout-minutes: 40
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install dependencies
run: |
sudo apt update && sudo apt install -y libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0
pip install -U pip
export PIP_EXTRA_INDEX_URL="https://dl.espressif.com/pypi"
pip install cryptography --prefer-binary
pip install -r requirements.txt
bash foreach.sh install
- name: Download and install QEMU
run: |
wget https://github.com/espressif/qemu/releases/download/esp-develop-9.2.2-20250817/qemu-xtensa-softmmu-esp_develop_9.2.2_20250817-x86_64-linux-gnu.tar.xz
wget https://github.com/espressif/qemu/releases/download/esp-develop-9.2.2-20250817/qemu-riscv32-softmmu-esp_develop_9.2.2_20250817-x86_64-linux-gnu.tar.xz
tar -xf qemu-xtensa-softmmu-esp_develop_9.2.2_20250817-x86_64-linux-gnu.tar.xz
tar -xf qemu-riscv32-softmmu-esp_develop_9.2.2_20250817-x86_64-linux-gnu.tar.xz
echo "$PWD/qemu/bin" >> $GITHUB_PATH
- name: Save PR number
run: echo ${{ github.event.number }} > pr_number.txt
- name: Run QEMU tests
run: |
pytest pytest-embedded-qemu/tests/test_qemu.py \
--junitxml pytest-qemu.xml \
--cov-report=xml:coverage-qemu.xml \
--cov=pytest_embedded \
--cov=pytest_embedded_arduino \
--cov=pytest_embedded_idf \
--cov=pytest_embedded_jtag \
--cov=pytest_embedded_qemu \
--cov=pytest_embedded_serial \
--cov=pytest_embedded_serial_esp \
--cov=pytest_embedded_wokwi \
--cov=pytest_embedded_nuttx
- name: Upload test results
uses: actions/upload-artifact@v7
if: always()
with:
name: test-results-qemu
path: |
pr_number.txt
pytest-qemu.xml
coverage-qemu.xml
test-python:
timeout-minutes: 40
strategy:
matrix:
include:
- python-version: "3.10"
arch: "ARM64"
- python-version: "3.14"
arch: "X64"
fail-fast: false
runs-on:
- self-hosted
- multiboard
- ${{ matrix.arch }}
container:
image: python:${{ matrix.python-version }}
options: --privileged
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
apt update && apt install -y socat zip
pip install -U pip
export PIP_EXTRA_INDEX_URL="https://dl.espressif.com/pypi"
pip install cryptography --prefer-binary
pip install -r requirements.txt
bash foreach.sh install
- name: Check ports
run: ls -la /dev/ttyUSB*
- name: Run Tests with coverage
run: |
pytest \
--junitxml=pytest-${{ matrix.python-version }}-${{ matrix.arch }}.xml \
--cov-report=xml:coverage-${{ matrix.python-version }}-${{ matrix.arch }}.xml \
--cov=pytest_embedded \
--cov=pytest_embedded_arduino \
--cov=pytest_embedded_idf \
--cov=pytest_embedded_jtag \
--cov=pytest_embedded_qemu \
--cov=pytest_embedded_serial \
--cov=pytest_embedded_serial_esp \
--cov=pytest_embedded_wokwi \
--cov=pytest_embedded_nuttx
- name: Upload test results
uses: actions/upload-artifact@v7
if: always()
with:
name: test-results-${{ matrix.python-version }}-${{ matrix.arch }}
path: |
pytest-${{ matrix.python-version }}-${{ matrix.arch }}.xml
coverage-${{ matrix.python-version }}-${{ matrix.arch }}.xml