forked from espressif/arduino-esp32
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (91 loc) · 3.36 KB
/
hil.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
name: Run tests in hardware
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
# schedule:
# - cron: '0 2 * * *'
concurrency:
group: build-${{github.event.pull_request.number || github.ref}}
cancel-in-progress: true
jobs:
prep_sketches:
if: contains(github.event.pull_request.labels.*.name, 'hil_test')
name: Prepare Sketches
runs-on: ubuntu-latest
outputs:
sketches: ${{ steps.prep-sketches.outputs.sketches }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Prepare Sketches
id: prep-sketches
run: |
SKETCHES=$(jq -c -n '$ARGS.positional' --args `find tests -mindepth 1 -maxdepth 1 -type d | cut -d"/" -f2`)
echo "::set-output name=sketches::${SKETCHES}"
Build:
needs: prep_sketches
name: Build ${{matrix.sketches}} for ${{matrix.fqbn}}
runs-on: ubuntu-latest
strategy:
matrix:
fqbn: ['esp32:esp32:esp32', 'esp32:esp32:esp32s2', 'esp32:esp32:esp32c3']
sketches: ${{fromJson(needs.prep_sketches.outputs.sketches)}}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Get target
run: echo "chip=$(echo ${{matrix.fqbn}} | cut -d":" -f3)" >> $GITHUB_ENV
- name: Build sketches
uses: arduino/compile-sketches@v1
with:
fqbn: ${{matrix.fqbn}}
platforms: |
- name: esp32:esp32
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
cli-compile-flags: |
- --build-path
- tests/${{matrix.sketches}}/build
sketch-paths: |
- tests/${{matrix.sketches}}
- name: Upload ${{matrix.sketches}}-${{env.chip}} artifacts
uses: actions/upload-artifact@v2
with:
name: ${{matrix.sketches}}-${{env.chip}}.artifacts
path: |
tests/${{matrix.sketches}}/build/*.bin
tests/${{matrix.sketches}}/build/*.json
Test:
needs: [prep_sketches, Build]
name: Test ${{matrix.sketches}} for ${{matrix.fqbn}}
runs-on: ESP32
env:
PYTHON_VERSION: 3.10.1
PYENV_VERSION: v2.2.3
strategy:
fail-fast: false
matrix:
fqbn: ['esp32:esp32:esp32', 'esp32:esp32:esp32s2', 'esp32:esp32:esp32c3']
sketches: ${{fromJson(needs.prep_sketches.outputs.sketches)}}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get target
run: echo "chip=$(echo ${{matrix.fqbn}} | cut -d":" -f3)" >> $GITHUB_ENV
- name: Download ${{matrix.sketches}}-${{env.chip}} artifacts
uses: actions/download-artifact@v2
with:
name: ${{matrix.sketches}}-${{env.chip}}.artifacts
path: tests/${{matrix.sketches}}/build
- name: Check chip
run: cat tests/${{matrix.sketches}}/build/build.options.json
- name: Install dependencies
run: |
~/.pyenv/versions/${{env.PYTHON_VERSION}}/bin/python -m venv test_venv
source test_venv/bin/activate
pip install -U pip
pip install -r tests/requirements.txt
- name: Run Tests
run: |
~/.pyenv/versions/${{env.PYTHON_VERSION}}/bin/python -m venv test_venv
source test_venv/bin/activate
pytest tests -k test_${{matrix.sketches}}