File tree Expand file tree Collapse file tree 5 files changed +46
-2
lines changed Expand file tree Collapse file tree 5 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -ef
4
4
5
- WORK_DIR=/home/esp/workspace/$1
6
-
7
5
echo " Compiling $1 "
8
6
9
7
cd /home/esp/workspace/$1
@@ -26,6 +24,8 @@ $HOME/.cargo/bin/cargo build
26
24
if [[ " $1 " == advanced/button-interrupt ]]; then
27
25
$HOME /.cargo/bin/cargo build --example solution
28
26
$HOME /.cargo/bin/cargo build --example solution_led
27
+ # Simulate with Wokwi
28
+ sed -i ' s/^[[:space:]]*firmware[[:space:]]*=[[:space:]]*["' " '" ' ]\([^"' " '" ' ]*\)["' " '" ' ]\([[:space:]]*\)$/\nfirmware = "target\/riscv32imc-esp-espidf\/debug\/examples\/solution"/' wokwi.toml
29
29
fi
30
30
31
31
if [[ " $1 " == advanced/i2c-sensor-reading ]]; then
36
36
if [[ " $1 " == intro/http-client ]]; then
37
37
$HOME /.cargo/bin/cargo build --example http_client
38
38
$HOME /.cargo/bin/cargo build --example https_client
39
+ # Simulate with Wokwi
40
+ sed -i ' s/^[[:space:]]*firmware[[:space:]]*=[[:space:]]*["' " '" ' ]\([^"' " '" ' ]*\)["' " '" ' ]\([[:space:]]*\)$/\nfirmware = "target\/riscv32imc-esp-espidf\/debug\/examples\/http_client"/' wokwi.toml
39
41
fi
40
42
41
43
if [[ " $1 " == intro/http-server ]]; then
Original file line number Diff line number Diff line change
1
+ name : button-interrupt test
2
+ version : 1
3
+ author : Sergio Gasquez Arcos
4
+
5
+ steps :
6
+ - delay : 100ms
7
+ - wait-serial : " GPIO[9]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1"
8
+ # Press once
9
+ - set-control :
10
+ part-id : btn1
11
+ control : pressed
12
+ value : 1
13
+ - delay : 100ms
14
+ - set-control :
15
+ part-id : btn1
16
+ control : pressed
17
+ value : 0
18
+ - wait-serial : " Button pressed!"
Original file line number Diff line number Diff line change
1
+ name : hardware-check test
2
+ version : 1
3
+ author : Sergio Gasquez Arcos
4
+
5
+ steps :
6
+ - delay : 5000ms
7
+ - wait-serial : " Hello, world!"
Original file line number Diff line number Diff line change
1
+ name : http-client test
2
+ version : 1
3
+ author : Sergio Gasquez Arcos
4
+
5
+ steps :
6
+ - delay : 5000ms
7
+ - wait-serial : " Response code: 200"
Original file line number Diff line number Diff line change 67
67
image : espressif/rust-std-training:latest
68
68
options : -u esp -v ${{ github.workspace }}:/home/esp/workspace
69
69
run : /bin/bash /home/esp/workspace/.devcontainer/test.sh ${{ matrix.project.path }}
70
+
71
+ - name : Wokwi CI check
72
+ if : matrix.project.name == 'button-interrupt' || matrix.project.name == 'http-client' || matrix.project.name == 'hardware-check'
73
+ uses : wokwi/wokwi-ci-action@v1
74
+ with :
75
+ token : ${{ secrets.WOKWI_CLI_TOKEN }}
76
+ path : ${{ matrix.project.path }}
77
+ timeout : 30000
78
+ scenario : .github/${{ matrix.project.name }}.test.yaml
79
+ fail_text : ' Error'
You can’t perform that action at this time.
0 commit comments