Skip to content

Commit f936825

Browse files
committed
ci: integration test workflow
1 parent d99ac1d commit f936825

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CLI Integration Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
cli-integration:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build CLI
28+
run: npm run build
29+
30+
- name: Clone test project
31+
run: git clone https://github.com/wokwi/esp-idf-hello-world.git test-project
32+
33+
- name: Create test scenario
34+
run: |
35+
cat > test-project/test-scenario.yaml << 'EOF'
36+
name: "Basic Hello World Test"
37+
version: 1
38+
description: "Test that the ESP32 hello world program outputs expected text"
39+
40+
steps:
41+
- name: "Wait for boot and hello message"
42+
wait-serial: "Hello world!"
43+
44+
- name: "Wait for chip information"
45+
wait-serial: "This is esp32 chip"
46+
47+
- name: "Wait for restart message"
48+
wait-serial: "Restarting in 10 seconds"
49+
EOF
50+
51+
- name: Run a Wokwi CI server
52+
uses: wokwi/wokwi-ci-server-action@v1
53+
54+
- name: Test CLI with basic expect-text
55+
run: npm start -- test-project --timeout 5000 --expect-text "Hello"
56+
env:
57+
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
58+
59+
- name: Test CLI with scenario file
60+
run: npm start -- test-project --scenario test-scenario.yaml --timeout 15000
61+
env:
62+
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
63+

0 commit comments

Comments
 (0)