Repository navigation
87 lines (70 loc) · 2.34 KB
/
Copy pathtests.yml
File metadata and controls
87 lines (70 loc) · 2.34 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
name: Tests
on:
workflow_dispatch:
push:
branches: [main, v2]
pull_request:
branches: [main, v2]
jobs:
test-ubuntu:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: ["3.10", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: pip install .
- name: Install test dependencies
run: pip install uhttp-server
- name: Run unit tests
run: python -m unittest discover -v tests/
test-windows:
runs-on: windows-latest
strategy:
max-parallel: 1
matrix:
python-version: ["3.10", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: pip install .
- name: Install test dependencies
run: pip install uhttp-server
- name: Run unit tests
run: python -m unittest discover -v tests/
micropython:
if: github.event_name == 'push'
needs: [test-ubuntu, test-windows]
runs-on: [self-hosted, Linux]
# One device, two maintained branches - queue instead of colliding, and
# never cancel: interrupting mpytool mid-operation wedges the REPL.
concurrency:
group: micropython-${{ matrix.device }}
cancel-in-progress: false
strategy:
fail-fast: false
matrix:
device: [ESP32]
steps:
- uses: actions/checkout@v4
- name: Install packages
run: |
$HOME/actions-runner/.venv/bin/pip install -e .
$HOME/actions-runner/.venv/bin/pip install 'mpytool>=2.4.0'
- name: MicroPython tests (${{ matrix.device }})
run: |
export PATH="$HOME/actions-runner/.venv/bin:$PATH"
export MPY_TEST_PORT="$(cat $HOME/actions-runner/.config/mpytool/${{ matrix.device }})"
export MPY_WIFI_SSID="$(jq -r .ssid $HOME/actions-runner/.config/uhttp/wifi.json)"
export MPY_WIFI_PASSWORD="$(jq -r .password $HOME/actions-runner/.config/uhttp/wifi.json)"
python -m unittest tests.test_mpy_integration -v