-
Notifications
You must be signed in to change notification settings - Fork 109
131 lines (118 loc) · 4.26 KB
/
esp32-simtest.yaml
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
#
# Copyright 2024 Davide Bettio <[email protected]>
# Copyright 2024 Peter Madsen-Mygdal <[email protected]>
#
# 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"
- "libs/**"
- "src/platforms/esp32/**"
- "src/platforms/esp32/**/**"
- "src/libAtomVM/**"
- "tools/packbeam/**"
pull_request:
paths:
- ".github/workflows/esp32-simtest.yaml"
- "src/platforms/esp32/**"
- "src/platforms/esp32/**/**"
- "src/libAtomVM/**"
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 }}
strategy:
fail-fast: false
# focus on device diversity.
matrix:
esp-idf-target:
[
"esp32",
"esp32s2",
"esp32s3",
"esp32c3",
"esp32c6",
"esp32h2",
"esp32p4",
]
idf-version: ${{ ((contains(github.event.head_commit.message, 'full_sim_test')||contains(github.event.pull_request.title, 'full_sim_test')) && fromJSON('["v5.1.5", "v5.2.3", "v5.3.2", "v5.4"]')) || fromJSON('["v5.3.2"]') }}
exclude:
- esp-idf-target: "esp32p4"
idf-version: "v5.1.5"
- esp-idf-target: "esp32p4"
idf-version: "v5.2.3"
- esp-idf-target: "esp32h2"
idf-version: "v5.1.5"
- esp-idf-target: "esp32h2"
idf-version: "v5.2.3"
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 erlang-base erlang-dev erlang-dialyzer erlang-eunit \
erlang-asn1 erlang-common-test erlang-crypto erlang-edoc \
erlang-parsetools erlang-reltool erlang-syntax-tools erlang-tools \
libglib2.0-0 libpixman-1-0 \
gcc g++ zlib1g-dev libsdl2-2.0-0 libslirp0 libmbedtls-dev
wget --no-verbose https://github.com/erlang/rebar3/releases/download/3.18.0/rebar3
chmod +x rebar3
./rebar3 local install
- 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 \
pytest-embedded==1.12.1 \
pytest-embedded-idf==1.12.1 \
pytest-embedded-qemu==1.12.1 \
pytest-embedded-wokwi==1.12.1
- 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: 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 --wokwi-timeout=240000 --target=${{ matrix.esp-idf-target }} --wokwi-diagram=sim_boards/diagram.${{ matrix.esp-idf-target }}.json -s