-
Notifications
You must be signed in to change notification settings - Fork 3
113 lines (99 loc) · 2.85 KB
/
test.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Test in Wokwi
on:
workflow_dispatch:
push:
schedule:
- cron: '42 5 * * *'
jobs:
test-hello-world:
runs-on: ubuntu-latest
strategy:
matrix:
idf_version:
- release-v4.4
- release-v5.0
- release-v5.1
- release-v5.2
- release-v5.3
- latest
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r test/requirements.txt
- name: Run a Wokwi CI server
uses: wokwi/wokwi-ci-server-action@v1
- name: Install Wokwi CLI
run: curl -L https://wokwi.com/ci/install.sh | sh
- name: Test on Wokwi
working-directory: test
run: pytest test_hello_world.py --report-log test_hello_world.json
env:
IDF_VERSION: ${{ matrix.idf_version }}
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-hello-world-${{ matrix.idf_version }}-results
path: test/test_hello_world.json
run-tests:
name: test-${{ matrix.test_name }}
runs-on: ubuntu-latest
strategy:
matrix:
test_name:
- adc
- crypto
- efuse
- gpio
- gptimer
- i2c
- nvs_flash
- pcnt
- psram
- spi_master
- timer
- uart
- usb_serial_jtag
- wifi_function
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r test/requirements.txt
- name: Run a Wokwi CI server
uses: wokwi/wokwi-ci-server-action@v1
- name: Install Wokwi CLI
run: curl -L https://wokwi.com/ci/install.sh | sh
- name: Test on Wokwi
working-directory: test
run: pytest test_${{ matrix.test_name }}.py --report-log test_${{ matrix.test_name }}.json
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-${{ matrix.test_name }}-results
path: test/test_${{ matrix.test_name }}.json
report:
needs: [test-hello-world, run-tests]
runs-on: ubuntu-latest
if: always()
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: test
merge-multiple: true
pattern: '!test-hello-world-release-v*.*-results'
- name: Generate test report
run: python test/generate_report.py >> $GITHUB_STEP_SUMMARY