forked from georgik/esp-wrover-kit-embedded-wizard-wokwi
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (61 loc) · 2.16 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Simulate with Wokwi + Screen Shot
on:
workflow_dispatch:
push:
jobs:
simulate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download prebuilt firmware
run: |
mkdir build
cd build
wget "https://github.com/georgik/esp-wrover-kit-embedded-wizard-wokwi/releases/download/v0.1/EmbeddedWizard-ESP-WROVER-KIT-merged.bin"
- name: Test with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
expect_text: 'Embedded Wizard'
- name: Simulate & take a screen shot
run: |
mkdir public
wokwi-cli --timeout 3000 --timeout-exit-code 0 --screenshot-part "lcd1" --screenshot-time 3000 --screenshot-file "public/screenshot.png" "${GITHUB_WORKSPACE}"
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
- name: Publish screen shot as artifact
uses: actions/upload-artifact@v4
with:
name: screenshot
path: public/screenshot.png
- name: Create an index.html file to preview screen shot
run:
echo "<html><body><img src='screenshot.png'></body></html>" > public/index.html
- name: Upload screen shot to GitHub pages
uses: actions/upload-pages-artifact@v3
with:
path: 'public'
deploy:
needs: simulate
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write
id-token: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Display screen shot in action summary
run: |
PAGE_URL=${{ steps.deployment.outputs.page_url }}
CACHE_BUSTER=$(date +%s)
cat << EOF >> $GITHUB_STEP_SUMMARY
# LCD screen shot (simulated with Wokwi)
![LCD Screen shot](${PAGE_URL}screenshot.png?cache_buster=$CACHE_BUSTER)
EOF