Skip to content

Configure Wokwi CI

Configure Wokwi CI #1

Workflow file for this run

name: Wokwi CI
on: [pull_request]
jobs:
provide-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
TMP="["
for FILE in examples/*/*.ino; do TMP="$TMP\"$FILE\","; done
TMP="${TMP::-1}]"
echo "::set-output name=matrix::$TMP"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
compile-arduino:
needs: provide-examples
strategy:
matrix:
example: ${{ fromJson(needs.provide-examples.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Install library dependencies
run: pio lib install
- name: Run PlatformIO
run: |
echo "Building ${{ matrix.example }}"
export LOCAL_BUILD=1
pio run --target clean
pio run
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
# - name: Test with Wokwi
# uses: wokwi/wokwi-ci-action@v1
# with:
# token: ${{ secrets.WOKWI_CLI_TOKEN }}
# scenario: 'button.test.yaml'