Fix network.erl race conditions #294
Workflow file for this run
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 }} | |
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", | |
"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-dialyzer \ | |
libglib2.0-0 libpixman-1-0 \ | |
gcc g++ zlib1g-dev libsdl2-2.0-0 libslirp0 libmbedtls-dev | |
- 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 | |
. $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 --wokwi-timeout=240000 --target=${{ matrix.esp-idf-target }} --wokwi-diagram=sim_boards/diagram.${{ matrix.esp-idf-target }}.json -s |