Skip to content

Commit 21faca5

Browse files
committed
👷 (Wokwi): Run test scenarios
1 parent ce11068 commit 21faca5

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

Diff for: .github/workflows/ci.yml

+41-2
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,55 @@ jobs:
8787
export PLATFORMIO_BUILD_DIR=$(grep -oP 'The following files/directories have been created in \K.*' output.log)
8888
echo "PLATFORMIO_BUILD_DIR=$PLATFORMIO_BUILD_DIR" >> "$GITHUB_ENV"
8989
env:
90+
FORCE_COLOR: 2 # Enable color output
9091
PLATFORMIO_CI_SRC: "./examples/${{ matrix.example }}/*.ino"
9192

9293
- name: Upload artifacts
9394
if: steps.metadata.outputs.upload_artifact == 'true'
9495
uses: actions/upload-artifact@v4
9596
with:
96-
# change the slash to a dash
9797
name: example-${{ steps.metadata.outputs.artifact_name }}
98-
# name: example-${{ matrix.example }}
9998
path: |
10099
${{ env.PLATFORMIO_BUILD_DIR }}/.pio/build/*/firmware.*
101100
retention-days: 1
102101

102+
wokwi:
103+
runs-on: ${{ matrix.os }}
104+
105+
needs: platformio
106+
107+
strategy:
108+
matrix:
109+
os: [ ubuntu-latest ]
110+
111+
include:
112+
- example: "MPU6050/BasicReadings"
113+
- board: uno
114+
115+
steps:
116+
- uses: actions/checkout@v4
117+
118+
- name: Prepare metadata
119+
id: metadata
120+
run: |
121+
ARTIFACT_NAME=$(echo "${{ matrix.example }}" | tr '/' '-')
122+
echo "artifact_name=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
123+
124+
- uses: actions/download-artifact@v4
125+
with:
126+
name: example-${{ steps.metadata.outputs.artifact_name }}
127+
path: build
128+
129+
- name: Copy compiled firmware
130+
run: |
131+
cp -ru build/${{ matrix.board }}/* examples/${{ matrix.example }}
132+
133+
- name: Run simulation
134+
uses: leon0399/wokwi-ci-action@main
135+
with:
136+
token: ${{ secrets.WOKWI_CLI_TOKEN }}
137+
timeout: 10000
138+
path: ./examples/${{ matrix.example }}
139+
scenario: 'scenario.yml'
140+
diagram_file: 'diagram.${{ matrix.board }}.json'
141+
elf: '${{ github.workspace }}/build/${{ matrix.board }}/firmware.elf'

Diff for: examples/MPU6050/BasicReadings/scenario.yml

Whitespace-only changes.

0 commit comments

Comments
 (0)