Skip to content

Commit 8545c50

Browse files
Remove std examples and templates (#15)
* feat: Remove std builders * fix: Update name of the docker image * ci: Avoid using -Z flags * ci: Fail if the build fails * ci: Add target to the matrix * ci: Improve name of steps * ci: Update blinky checks
1 parent c43be5f commit 8545c50

File tree

3 files changed

+48
-119
lines changed

3 files changed

+48
-119
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
projects:
18-
name: "${{ matrix.project.name }} | ${{ matrix.project.mcu }} | ${{ matrix.project.env }} | ${{ matrix.project.id }}"
18+
name: "${{ matrix.project.name }} | ${{ matrix.project.mcu }} | ${{ matrix.project.id }}"
1919
runs-on: ubuntu-latest
2020
strategy:
2121
fail-fast: false
@@ -24,160 +24,106 @@ jobs:
2424
# Templates
2525
- name: template
2626
id: "341952531613614675"
27-
env: nostd
28-
mcu: esp32
29-
- name: template
30-
id: "338154815612781140"
31-
env: std
3227
mcu: esp32
28+
target: "xtensa-esp32-none-elf"
3329
- name: template
3430
id: "341956530834244180"
35-
env: nostd
36-
mcu: esp32c3
37-
- name: template
38-
id: "338322025101656660"
39-
env: std
4031
mcu: esp32c3
32+
target: "riscv32imc-unknown-none-elf"
4133
## Rust Board
4234
- name: template
4335
id: "341957109819114067"
44-
env: nostd
45-
mcu: esp32c3
46-
- name: template
47-
id: "338322111264195156"
48-
env: std
4936
mcu: esp32c3
37+
target: "riscv32imc-unknown-none-elf"
5038
- name: template
5139
id: "377857146822034433"
52-
env: nostd
53-
mcu: esp32c6
54-
- name: template
55-
id: "377833187169638401"
56-
env: std
5740
mcu: esp32c6
41+
target: "riscv32imac-unknown-none-elf"
5842
- name: template
5943
id: "379094104004151297"
60-
env: nostd
61-
mcu: esp32h2
62-
- name: template
63-
id: "379361398729686017"
64-
env: std
6544
mcu: esp32h2
45+
target: "riscv32imac-unknown-none-elf"
6646
- name: template
6747
id: "341955277702038100"
68-
env: nostd
69-
mcu: esp32s2
70-
- name: template
71-
id: "338154940543271506"
72-
env: std
7348
mcu: esp32s2
49+
target: "xtensa-esp32s2-none-elf"
7450
- name: template
7551
id: "349566517066596948"
76-
env: nostd
77-
mcu: esp32s3
78-
- name: template
79-
id: "345144250522927698"
80-
env: std
8152
mcu: esp32s3
53+
target: "xtensa-esp32s3-none-elf"
8254
# Examples
8355
- name: blinky
8456
id: "341952826535051858"
85-
env: nostd
86-
mcu: esp32
87-
- name: blinky
88-
id: "333363577816613460"
89-
env: std
9057
mcu: esp32
58+
target: "xtensa-esp32-none-elf"
9159
- name: blinky
9260
id: "341956526159692371"
93-
env: nostd
94-
mcu: esp32c3
95-
- name: blinky
96-
id: "332188235906155092"
97-
env: std
9861
mcu: esp32c3
62+
target: "riscv32imc-unknown-none-elf"
9963
- name: blinky
10064
id: "378092585951093761"
101-
env: nostd
102-
mcu: esp32c6
103-
- name: blinky
104-
id: "378092245692314625"
105-
env: std
10665
mcu: esp32c6
66+
target: "riscv32imac-unknown-none-elf"
10767
- name: blinky
10868
id: "379361473820314625"
109-
env: nostd
110-
mcu: esp32h2
111-
- name: blinky
112-
id: "379361684344001537"
113-
env: std
11469
mcu: esp32h2
70+
target: "riscv32imac-unknown-none-elf"
11571
- name: blinky
11672
id: "341955297469792851"
117-
env: nostd
118-
mcu: esp32s2
119-
- name: blinky
120-
id: "333363982163247699"
121-
env: std
12273
mcu: esp32s2
74+
target: "xtensa-esp32s2-none-elf"
12375
- name: blinky
12476
id: "349568945405035090"
125-
env: nostd
126-
mcu: esp32s3
127-
- name: blinky
128-
id: "361808947755817985"
129-
env: std
13077
mcu: esp32s3
78+
target: "xtensa-esp32s3-none-elf"
13179
steps:
13280
- name: Checkout the repository
13381
uses: actions/checkout@v4
13482

13583
- name: Download project code
13684
run: |
137-
wget -q -O ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}.zip https://wokwi.com/api/projects/${{ matrix.project.id }}/zip
138-
unzip ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}.zip -d ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}
139-
- name: Create wokwi.toml (nostd)
140-
if: matrix.project.env == 'nostd'
141-
run: echo -e "[wokwi]\nversion = 1\nfirmware = 'rust_project_${{ matrix.project.mcu }}'\nelf = 'rust_project_${{ matrix.project.mcu }}'" > ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}/wokwi.toml
142-
- name: Create wokwi.toml (std)
143-
if: matrix.project.env == 'std'
144-
run: echo -e "[wokwi]\nversion = 1\nfirmware = 'rust-project-${{ matrix.project.mcu }}'\nelf = 'rust-project-${{ matrix.project.mcu }}'" > ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}/wokwi.toml
85+
wget -q -O ${{ matrix.project.mcu }}_${{ matrix.project.id }}.zip https://wokwi.com/api/projects/${{ matrix.project.id }}/zip
86+
unzip ${{ matrix.project.mcu }}_${{ matrix.project.id }}.zip -d ${{ matrix.project.mcu }}_${{ matrix.project.id }}
87+
88+
- name: Create wokwi.toml
89+
run: echo -e "[wokwi]\nversion = 1\nfirmware = 'rust_project_${{ matrix.project.mcu }}'\nelf = 'rust_project_${{ matrix.project.mcu }}'" > ${{ matrix.project.mcu }}_${{ matrix.project.id }}/wokwi.toml
14590

14691
- name: Update ownership
14792
run: |
148-
sudo chown 1000:1000 -R ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}
93+
sudo chown 1000:1000 -R ${{ matrix.project.mcu }}_${{ matrix.project.id }}
14994
15095
- name: Pull Docker image
151-
run: docker image pull wokwi/builder-rust-${{ matrix.project.env }}-esp
96+
run: docker image pull wokwi/builder-rust-nostd-esp
15297

15398
- name: Test code example in Docker image
15499
uses: addnab/docker-run-action@v3
155100
with:
156-
image: wokwi/builder-rust-${{ matrix.project.env }}-esp
101+
image: wokwi/builder-rust-nostd-esp
157102
options: -u esp -v ${{ github.workspace }}:/home/esp/workspace
158103
run: |
159104
. /home/esp/export-esp.sh
160-
cp /home/esp/workspace/${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}/*.rs rust-project-${{ matrix.project.mcu }}/src/
161-
cat /home/esp/workspace/${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}/Cargo.toml > rust-project-${{ matrix.project.mcu }}/Cargo.toml
105+
cp /home/esp/workspace/${{ matrix.project.mcu }}_${{ matrix.project.id }}/*.rs rust-project-${{ matrix.project.mcu }}/src/
106+
cat /home/esp/workspace/${{ matrix.project.mcu }}_${{ matrix.project.id }}/Cargo.toml > rust-project-${{ matrix.project.mcu }}/Cargo.toml
162107
cd rust-project-${{ matrix.project.mcu }}
163-
cargo build --release --out-dir /home/esp/workspace/${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }} -Z unstable-options
108+
cargo build --release || exit 1
109+
cp target/${{ matrix.project.target }}/release/rust_project_${{ matrix.project.mcu }} /home/esp/workspace/${{ matrix.project.mcu }}_${{ matrix.project.id }}
164110
165-
- name: Wokwi CI check
111+
- name: Wokwi CI check (template)
166112
if: matrix.project.name == 'template'
167113
uses: wokwi/wokwi-ci-action@v1
168114
with:
169115
token: ${{ secrets.WOKWI_CLI_TOKEN }}
170-
path: ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}
116+
path: ${{ matrix.project.mcu }}_${{ matrix.project.id }}
171117
timeout: 10000
172118
expect_text: 'Hello world!'
173119
fail_text: 'Error'
174120

175-
- name: Wokwi CI check
121+
- name: Wokwi CI check (blinky)
176122
if: matrix.project.name == 'blinky'
177123
uses: wokwi/wokwi-ci-action@v1
178124
with:
179125
token: ${{ secrets.WOKWI_CLI_TOKEN }}
180-
path: ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}
126+
path: ${{ matrix.project.mcu }}_${{ matrix.project.id }}
181127
timeout: 10000
182128
scenario: ../blinky.test.yaml
183129
fail_text: 'Error'
@@ -186,5 +132,5 @@ jobs:
186132
if: success() || failure()
187133
uses: actions/upload-artifact@v4
188134
with:
189-
name: ${{ matrix.project.name }}-${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}
190-
path: ${{ matrix.project.mcu }}-${{ matrix.project.env }}_${{ matrix.project.id }}
135+
name: ${{ matrix.project.name }}_${{ matrix.project.mcu }}_${{ matrix.project.id }}
136+
path: ${{ matrix.project.mcu }}_${{ matrix.project.id }}

README.md

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,20 @@
33
[![CI](https://github.com/SergioGasquez/wokwi-projects/actions/workflows/ci.yml/badge.svg)](https://github.com/SergioGasquez/wokwi-projects/actions/workflows/ci.yml)
44

55
## Templates
6-
- `std`
7-
- [ESP32](https://wokwi.com/projects/338154815612781140)
8-
- [ESP32-C3](https://wokwi.com/projects/338322025101656660)
9-
- [ESP32-C3 Rust Board](https://wokwi.com/projects/338322111264195156)
10-
- [ESP32-C6](https://wokwi.com/projects/377833187169638401)
11-
- [ESP32-H2](https://wokwi.com/projects/379361398729686017)
12-
- [ESP32-S2](https://wokwi.com/projects/338154940543271506)
13-
- [ESP32-S3](https://wokwi.com/projects/345144250522927698)
14-
- `no_std`
15-
- [ESP32](https://wokwi.com/projects/341952531613614675)
16-
- [ESP32-C3](https://wokwi.com/projects/341956530834244180)
17-
- [ESP32-C3 Rust Board](https://wokwi.com/projects/341957109819114067)
18-
- [ESP32-C6](https://wokwi.com/projects/377857146822034433)
19-
- [ESP32-H2](https://wokwi.com/projects/379094104004151297)
20-
- [ESP32-S2](https://wokwi.com/projects/341955277702038100)
21-
- [ESP32-S3](https://wokwi.com/projects/349566517066596948)
6+
- [ESP32](https://wokwi.com/projects/341952531613614675)
7+
- [ESP32-C3](https://wokwi.com/projects/341956530834244180)
8+
- [ESP32-C3 Rust Board](https://wokwi.com/projects/341957109819114067)
9+
- [ESP32-C6](https://wokwi.com/projects/377857146822034433)
10+
- [ESP32-H2](https://wokwi.com/projects/379094104004151297)
11+
- [ESP32-S2](https://wokwi.com/projects/341955277702038100)
12+
- [ESP32-S3](https://wokwi.com/projects/349566517066596948)
2213

2314
## Examples
24-
- `std`
25-
- [ESP32 | std | Blinky](https://wokwi.com/projects/333363577816613460)
26-
- [ESP32-C3 | std | Blinky](https://wokwi.com/projects/332188235906155092)
27-
- [ESP32-C6 | std | Blinky](https://wokwi.com/projects/378092245692314625)
28-
- [ESP32-H2 | std | Blinky](https://wokwi.com/projects/379361684344001537)
29-
- [ESP32-S2 | std | Blinky](https://wokwi.com/projects/333363982163247699)
30-
- [ESP32-S3 | std | Blinky](https://wokwi.com/projects/361808947755817985)
31-
- `no_std`
32-
- [ESP32 | no_std | Blinky](https://wokwi.com/projects/341952826535051858)
33-
- [ESP32-C3 | no_std | Blinky](https://wokwi.com/projects/341956526159692371)
34-
- [ESP32-C6 | no_std | Blinky](https://wokwi.com/projects/378092585951093761)
35-
- [ESP32-H2 | no_std | Blinky](https://wokwi.com/projects/379361473820314625)
36-
- [ESP32-S2 | no_std | Blinky](https://wokwi.com/projects/341955297469792851)
37-
- [ESP32-S3 | no_std | Blinky](https://wokwi.com/projects/349568945405035090)
15+
- [ESP32 | no_std | Blinky](https://wokwi.com/projects/341952826535051858)
16+
- [ESP32-C3 | no_std | Blinky](https://wokwi.com/projects/341956526159692371)
17+
- [ESP32-C6 | no_std | Blinky](https://wokwi.com/projects/378092585951093761)
18+
- [ESP32-H2 | no_std | Blinky](https://wokwi.com/projects/379361473820314625)
19+
- [ESP32-S2 | no_std | Blinky](https://wokwi.com/projects/341955297469792851)
20+
- [ESP32-S3 | no_std | Blinky](https://wokwi.com/projects/349568945405035090)
3821

3922

blinky.test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ steps:
88
- expect-pin:
99
part-id: r1
1010
pin: 1
11-
value: 1
12-
- delay: 1250ms
11+
value: 0
12+
- delay: 600ms
1313
- expect-pin:
1414
part-id: r1
1515
pin: 1
16-
value: 0
16+
value: 1

0 commit comments

Comments
 (0)