-
Notifications
You must be signed in to change notification settings - Fork 149
166 lines (149 loc) · 5.1 KB
/
esp32-simtest.yaml
File metadata and controls
166 lines (149 loc) · 5.1 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#
# Copyright 2024 Davide Bettio <davide@uninstall.it>
# Copyright 2024 Peter Madsen-Mygdal <petermm@gmail.com>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#
name: ESP32 Sim test
on:
push:
paths:
- ".github/workflows/esp32-simtest.yaml"
- "CMakeLists.txt"
- 'CMakeModules/**'
- "libs/**"
- "src/platforms/esp32/**"
- "src/platforms/esp32/**/**"
- "src/libAtomVM/**"
- "tools/packbeam/**"
pull_request:
paths:
- ".github/workflows/esp32-simtest.yaml"
- "CMakeLists.txt"
- 'CMakeModules/**'
- "libs/**"
- "src/platforms/esp32/**"
- "src/platforms/esp32/**/**"
- "src/libAtomVM/**"
- "tools/packbeam/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
cli_token:
name: WOKWI_CLI_TOKEN presence
runs-on: ubuntu-24.04
outputs:
token_check: ${{ steps.token_check.outputs.should-run }}
steps:
- name: Mark esp-sim-test job as 'to be run'
id: token_check
env:
wokwi_secret: ${{ secrets.WOKWI_CLI_TOKEN }}
run: |
if [${{ env.wokwi_secret }} == ''];
then
echo "WOKWI_CLI_TOKEN not found, please add it to your repository secrets"
else
echo "WOKWI_CLI_TOKEN found continuing..."
echo "should-run=true" >> $GITHUB_OUTPUT
fi
esp-sim-test:
needs: cli_token
runs-on: ubuntu-24.04
if: needs.cli_token.outputs.token_check == 'true'
container: espressif/idf:${{ matrix.idf-version }}
services:
wokwi-ci-server:
image: wokwi/wokwi-ci-server
ports:
- 3000:3000
strategy:
fail-fast: false
# focus on device diversity.
matrix:
esp-idf-target:
[
"esp32",
"esp32s2",
"esp32s3",
"esp32c3",
"esp32c5",
"esp32c6",
"esp32h2"
]
idf-version: ${{ ((contains(github.event.head_commit.message, 'full_sim_test')||contains(github.event.pull_request.title, 'full_sim_test')) && fromJSON('["v5.2.6", "v5.3.4", "v5.4.3", "v5.5.3"]')) || fromJSON('["v5.5.3"]') }}
exclude:
- esp-idf-target: "esp32p4"
idf-version: "v5.2.6"
- esp-idf-target: "esp32h2"
idf-version: "v5.2.6"
- esp-idf-target: "esp32c5"
idf-version: "v5.2.6"
- esp-idf-target: "esp32c5"
idf-version: "v5.3.4"
- esp-idf-target: "esp32c5"
idf-version: "v5.4.3"
# CI now uses chip revision 3 that is currently only available since 5.5.2
include:
- esp-idf-target: "esp32p4"
idf-version: "v5.5.3"
- esp-idf-target: "esp32c61"
idf-version: "v5.5.3"
- esp-idf-target: "esp32"
idf-version: "v6.0"
- esp-idf-target: "esp32s3"
idf-version: "v6.0"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies to build host AtomVM
run: |
set -eu
apt update
DEBIAN_FRONTEND=noninteractive apt install -y -q \
doxygen libglib2.0-0 libpixman-1-0 \
gcc g++ zlib1g-dev libsdl2-2.0-0 libslirp0 libmbedtls-dev
- name: "Set ImageOS for erlef/setup-beam"
run: |
sed -n -E -e 's|VERSION_ID="(.+)\..+"|ImageOS=ubuntu\1|p' /etc/os-release >> ${GITHUB_ENV}
- uses: erlef/setup-beam@v1
with:
otp-version: "28"
rebar3-version: "3.25.1"
hexpm-mirrors: |
https://builds.hex.pm
https://repo.hex.pm
https://cdn.jsdelivr.net/hex
- name: Install the Wokwi CLI
run: curl -L https://wokwi.com/ci/install.sh | sh
- name: Install pytest and pytest-embedded plugins
run: |
set -e
. $IDF_PATH/export.sh
pip install pytest==8.3.4 \
esptool==5.2.0 \
pytest-embedded==2.7.0 \
pytest-embedded-idf==2.7.0 \
pytest-embedded-qemu==2.7.0 \
pytest-embedded-wokwi==2.7.0
- name: Set SDKCONFIG_DEFAULTS and Build ESP32-sim tests using idf.py
working-directory: ./src/platforms/esp32/test/
run: |
set -e
export PATH=${PATH}:${HOME}/.cache/rebar3/bin
. $IDF_PATH/export.sh
idf.py -DSDKCONFIG_DEFAULTS='sdkconfig.ci.wokwi' set-target ${{matrix.esp-idf-target}}
idf.py build
- name: Configure Wokwi environment
run: |
echo "WOKWI_CLI_SERVER=ws://wokwi-ci-server:3000" >> $GITHUB_ENV
- name: Run ESP32-sim tests using Wokwi CI
working-directory: ./src/platforms/esp32/test/
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
timeout-minutes: 10
run: |
set -e
. $IDF_PATH/export.sh
pytest --embedded-services=idf,wokwi --target=${{ matrix.esp-idf-target }} --wokwi-diagram=sim_boards/diagram.${{ matrix.esp-idf-target }}.json -s