-
Notifications
You must be signed in to change notification settings - Fork 106
150 lines (134 loc) · 5.56 KB
/
esp32-build.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#
# Copyright 2022 Davide Bettio <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#
name: ESP32 Builds
on:
push:
paths:
- '.github/workflows/esp32-build.yaml'
- 'CMakeLists.txt'
- 'libs/**'
- 'src/platforms/esp32/**'
- 'src/platforms/esp32/**/**'
- 'src/libAtomVM/**'
- 'tools/packbeam/**'
pull_request:
paths:
- '.github/workflows/esp32-build.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:
esp-idf:
runs-on: ubuntu-latest
container: espressif/idf:${{ matrix.idf-version }}
strategy:
fail-fast: false
matrix:
esp-idf-target: ["esp32", "esp32c3"]
idf-version:
- 'v5.0.7'
- 'v5.1.4'
- 'v5.2.2'
- 'v5.3.1'
exclude:
- esp-idf-target: "esp32c3"
idf-version: 'v5.0.7'
- esp-idf-target: "esp32c3"
idf-version: 'v5.1.4'
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build with idf.py
shell: bash
working-directory: ./src/platforms/esp32/
run: |
. $IDF_PATH/export.sh
export IDF_TARGET=${{matrix.esp-idf-target}}
idf.py set-target ${{matrix.esp-idf-target}}
idf.py build
idf.py size
- name: Print component size info with idf.py
shell: bash
working-directory: ./src/platforms/esp32/
run: |
. $IDF_PATH/export.sh
idf.py size-components
- name: Install dependencies to build host AtomVM and run qemu
run: |
set -eu
apt update
DEBIAN_FRONTEND=noninteractive apt install -y -q \
doxygen erlang-base erlang-dialyzer \
libglib2.0-0 libpixman-1-0 \
gcc g++ zlib1g-dev libsdl2-2.0-0 libslirp0 libmbedtls-dev
- name: Install qemu binary from espressif/qemu esp32
if: runner.arch != 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32'
run: |
set -eu
QEMU_VER=esp-develop-9.0.0-20240606
QEMU_XTENSA_DIST=qemu-xtensa-softmmu-esp_develop_9.0.0_20240606-x86_64-linux-gnu.tar.xz
QEMU_XTENSA_SHA256=071d117c44a6e9a1bc8664ab63b592d3e17ceb779119dcb46c59571a4a7a88c9
wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_XTENSA_DIST}
echo "${QEMU_XTENSA_SHA256} *${QEMU_XTENSA_DIST}" | sha256sum --check --strict -
tar -xf ${QEMU_XTENSA_DIST} -C /opt && rm ${QEMU_XTENSA_DIST}
- name: Install qemu binary from espressif/qemu esp32c3
if: runner.arch != 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32c3'
run: |
set -eu
QEMU_VER=esp-develop-9.0.0-20240606
QEMU_RISCV32_DIST=qemu-riscv32-softmmu-esp_develop_9.0.0_20240606-x86_64-linux-gnu.tar.xz
QEMU_RISCV32_SHA256=47120e826cfec7180db8cb611a7a4aed2e9b2191c2a739194f8ce085e63cdd8d
wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_RISCV32_DIST}
echo "${QEMU_RISCV32_SHA256} *${QEMU_RISCV32_DIST}" | sha256sum --check --strict -
tar -xf ${QEMU_RISCV32_DIST} -C /opt && rm ${QEMU_RISCV32_DIST}
- name: Install qemu binary from espressif/qemu ARM64 esp32
if: runner.arch == 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32'
run: |
set -eu
QEMU_VER=esp-develop-9.0.0-20240606
QEMU_XTENSA_DIST=qemu-xtensa-softmmu-esp_develop_9.0.0_20240606-aarch64-linux-gnu.tar.xz
QEMU_XTENSA_SHA256=43552f32b303a6820d0d9551903e54fc221aca98ccbd04e5cbccbca881548008
wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_XTENSA_DIST}
echo "${QEMU_XTENSA_SHA256} *${QEMU_XTENSA_DIST}" | sha256sum --check --strict -
tar -xf ${QEMU_XTENSA_DIST} -C /opt && rm ${QEMU_XTENSA_DIST}
- name: Install qemu binary from espressif/qemu ARM64 esp32c3
if: runner.arch == 'ARM64' && runner.os == 'Linux' && matrix.esp-idf-target == 'esp32c3'
run: |
set -eu
QEMU_VER=esp-develop-9.0.0-20240606
QEMU_RISCV32_DIST=qemu-riscv32-softmmu-esp_develop_9.0.0_20240606-aarch64-linux-gnu.tar.xz
QEMU_RISCV32_SHA256=3b6221a8b1881d2c9b9fa0b0bf8d7065c84153d2a54e429307bde9feae235c27
wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_RISCV32_DIST}
echo "${QEMU_RISCV32_SHA256} *${QEMU_RISCV32_DIST}" | sha256sum --check --strict -
tar -xf ${QEMU_RISCV32_DIST} -C /opt && rm ${QEMU_RISCV32_DIST}
- name: Install pytest and pytest-embedded plugins
run: |
set -e
. $IDF_PATH/export.sh
pip install pytest==8.2.2 \
pytest-embedded==1.10.3 \
pytest-embedded-serial-esp==1.10.3 \
pytest-embedded-idf==1.10.3 \
pytest-embedded-qemu==1.10.3
- name: Build ESP32 tests using idf.py
working-directory: ./src/platforms/esp32/test/
run: |
set -e
. $IDF_PATH/export.sh
export IDF_TARGET=${{matrix.esp-idf-target}}
idf.py set-target ${{matrix.esp-idf-target}}
idf.py build
- name: Run ESP32 tests using qemu
working-directory: ./src/platforms/esp32/test/
timeout-minutes: 10
run: |
set -e
. $IDF_PATH/export.sh
export PATH=/opt/qemu/bin:${PATH}
pytest --target=${{matrix.esp-idf-target}} --embedded-services=idf,qemu -s