Skip to content

Test in Wokwi

Test in Wokwi #237

Workflow file for this run

name: Test in Wokwi
on:
workflow_dispatch:
push:
schedule:
- cron: '42 5 * * *'
jobs:
test-hello-world:
runs-on: ubuntu-latest
strategy:
matrix:
idf_version:
- release-v4.4
- release-v5.0
- release-v5.1
- release-v5.2
- release-v5.3
- latest
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r test/requirements.txt
- name: Run a Wokwi CI server
uses: wokwi/wokwi-ci-server-action@v1
- name: Install Wokwi CLI
run: curl -L https://wokwi.com/ci/install.sh | sh
- name: Test on Wokwi
working-directory: test
run: pytest test_hello_world.py --report-log test_hello_world.json
env:
IDF_VERSION: ${{ matrix.idf_version }}
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-hello-world-${{ matrix.idf_version }}-results
path: test/test_hello_world.json
run-tests:
name: test-${{ matrix.test_name }}
runs-on: ubuntu-latest
strategy:
matrix:
test_name:
- adc
- crypto
- efuse
- gpio
- gptimer
- i2c
- nvs_flash
- pcnt
- psram
- spi_master
- timer
- uart
- usb_serial_jtag
- wifi_function
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r test/requirements.txt
- name: Run a Wokwi CI server
uses: wokwi/wokwi-ci-server-action@v1
- name: Install Wokwi CLI
run: curl -L https://wokwi.com/ci/install.sh | sh
- name: Test on Wokwi
working-directory: test
run: pytest test_${{ matrix.test_name }}.py --report-log test_${{ matrix.test_name }}.json
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-${{ matrix.test_name }}-results
path: test/test_${{ matrix.test_name }}.json
report:
needs: [test-hello-world, run-tests]
runs-on: ubuntu-latest
if: always()
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: test
merge-multiple: true
pattern: '!test-hello-world-release-v*.*-results'
- name: Generate test report
run: python test/generate_report.py >> $GITHUB_STEP_SUMMARY