Introduce erlang distribution #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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"] | |
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-beta1"]')) || fromJSON('["v5.3.2"]') }} | |
include: | |
- esp-idf-target: "esp32p4" | |
idf-version: "v5.3.2" | |
- esp-idf-target: "esp32h2" | |
idf-version: "v5.3.2" | |
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 |