@@ -87,16 +87,55 @@ jobs:
87
87
export PLATFORMIO_BUILD_DIR=$(grep -oP 'The following files/directories have been created in \K.*' output.log)
88
88
echo "PLATFORMIO_BUILD_DIR=$PLATFORMIO_BUILD_DIR" >> "$GITHUB_ENV"
89
89
env :
90
+ FORCE_COLOR : 2 # Enable color output
90
91
PLATFORMIO_CI_SRC : " ./examples/${{ matrix.example }}/*.ino"
91
92
92
93
- name : Upload artifacts
93
94
if : steps.metadata.outputs.upload_artifact == 'true'
94
95
uses : actions/upload-artifact@v4
95
96
with :
96
- # change the slash to a dash
97
97
name : example-${{ steps.metadata.outputs.artifact_name }}
98
- # name: example-${{ matrix.example }}
99
98
path : |
100
99
${{ env.PLATFORMIO_BUILD_DIR }}/.pio/build/*/firmware.*
101
100
retention-days : 1
102
101
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'
0 commit comments