Skip to content

Commit aa19006

Browse files
committed
ci: checkexamples can use the same template
1 parent 2c63a09 commit aa19006

File tree

1 file changed

+44
-83
lines changed

1 file changed

+44
-83
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -108,102 +108,65 @@ jobs:
108108
# Clippy (hifive1) TODO
109109
# clippyhifive1:
110110

111-
# Platform lm3s6965: verify all examples, checks
112-
checkexampleslm3s6965:
113-
name: check examples (lm3s6965)
111+
# Verify all examples, checks
112+
checkexamples:
113+
name: check examples
114114
runs-on: ubuntu-22.04
115115
strategy:
116116
matrix:
117-
backend:
118-
- thumbv7
119-
- thumbv6
120-
- thumbv8-base
121-
- thumbv8-main
122-
toolchain:
123-
- stable
124-
steps:
125-
- name: Checkout
126-
uses: actions/checkout@v4
127-
128-
- name: Install Rust ${{ matrix.toolchain }}
129-
run: |
130-
rustup override set ${{ matrix.toolchain }}
131-
132-
- name: Configure Rust target (v6, v7, v8.b v8.m)
133-
run: |
134-
rustup target add thumbv7m-none-eabi
135-
rustup target add thumbv6m-none-eabi
136-
rustup target add thumbv8m.base-none-eabi
137-
rustup target add thumbv8m.main-none-eabi
138-
139-
- name: Cache Dependencies
140-
uses: Swatinem/rust-cache@v2
117+
input:
118+
- backend: thumbv7
119+
platform: lm3s6965
120+
rustup-target: thumbv7m-none-eabi
121+
122+
- backend: thumbv6
123+
platform: lm3s6965
124+
rustup-target: thumbv6m-none-eabi
125+
126+
- backend: thumbv8-base
127+
platform: lm3s6965
128+
rustup-target: thumbv8m.base-none-eabi
129+
130+
- backend: thumbv8-main
131+
platform: lm3s6965
132+
rustup-target: thumbv8m.main-none-eabi
133+
134+
- backend: riscv32-imc-clint
135+
platform: hifive1
136+
rustup-target: thumbv7m-none-eabi
137+
custom-toolchain: rustup toolchain install nightly-2023-11-14 --component rust-src --target riscv32imc-unknown-none-elf && rustup override set nightly
138+
139+
- backend: riscv32-imc-mecall
140+
platform: hifive1
141+
rustup-target: riscv32imc-unknown-none-elf
142+
custom-toolchain: rustup toolchain install nightly-2023-11-14 --component rust-src --target riscv32imc-unknown-none-elf && rustup override set nightly
143+
144+
- backend: riscv-esp32-c3
145+
platform: esp32-c3
146+
rustup-target: riscv32imc-unknown-none-elf
147+
custom-toolchain: rustup toolchain install nightly-2023-11-14 --component rust-src --target riscv32imc-unknown-none-elf && rustup override set nightly
141148

142-
- name: Check the examples
143-
if: ${{ matrix.backend == 'thumbv8-base' }}
144-
run: cargo xtask --platform lm3s6965 --backend ${{ matrix.backend }} --exampleexclude pool example-check
145-
146-
- name: Check the examples
147-
if: ${{ matrix.backend != 'thumbv8-base' }}
148-
run: cargo xtask --platform lm3s6965 --backend ${{ matrix.backend }} example-check
149-
150-
# Platform hifive1: verify all examples, checks
151-
checkexampleshifive1:
152-
name: check examples (hifive1)
153-
runs-on: ubuntu-22.04
154-
strategy:
155-
matrix:
156-
backend:
157-
- riscv32-imc-clint
158-
- riscv32-imc-mecall
159-
toolchain:
160-
- stable
161149
steps:
162150
- name: Checkout
163151
uses: actions/checkout@v4
164152

165-
- name: Install Rust ${{ matrix.toolchain }}
166-
run: |
167-
rustup override set ${{ matrix.toolchain }}
153+
- name: Install optional custom toolchain
154+
if: matrix.input.custom-toolchain
155+
run: ${{ matrix.input.custom-toolchain }}
168156

169157
- name: Configure Rust target
170-
run: |
171-
rustup target add riscv32imc-unknown-none-elf
158+
run: rustup target add ${{ matrix.input.rustup-target }}
172159

173160
- name: Cache Dependencies
174161
uses: Swatinem/rust-cache@v2
175-
176-
- name: Check the examples
177-
run: cargo xtask --platform hifive1 --backend ${{ matrix.backend }} example-check
178162

179-
# Platform esp32c3: verify all examples, checks
180-
checkexamplesesp32c3:
181-
name: check examples (esp32c3)
182-
runs-on: ubuntu-22.04
183-
strategy:
184-
matrix:
185-
backend:
186-
- riscv-esp32-c3
187-
toolchain:
188-
- nightly
189-
steps:
190-
- name: Checkout
191-
uses: actions/checkout@v4
192-
193-
- name: Install Rust ${{ matrix.toolchain }}
194-
run: |
195-
rustup toolchain install nightly-2023-11-14 --component rust-src --target riscv32imc-unknown-none-elf
196-
197-
- name: Configure Rust target
198-
run: |
199-
rustup target add riscv32imc-unknown-none-elf
200-
201-
- name: Cache Dependencies
202-
uses: Swatinem/rust-cache@v2
203-
204163
- name: Check the examples
205-
run: cargo xtask --platform esp32-c3 --backend ${{ matrix.backend }} example-check
164+
if: ${{ matrix.input.backend == 'thumbv8-base' }}
165+
run: cargo xtask --platform ${{ matrix.input.platform }} --backend ${{ matrix.input.backend }} --exampleexclude pool example-check
206166

167+
- name: Check the examples
168+
if: ${{ matrix.input.backend != 'thumbv8-base' }}
169+
run: cargo xtask --platform ${{ matrix.input.platform }} --backend ${{ matrix.input.backend }} example-check
207170

208171
buildqemu:
209172
name: Get modern QEMU, build and store
@@ -888,9 +851,7 @@ jobs:
888851
# - checkhifive1 # TODO
889852
- clippylm3s6965
890853
# - clippyhifive1 # TODO
891-
- checkexampleslm3s6965
892-
- checkexampleshifive1
893-
- checkexamplesesp32c3
854+
- checkexamples
894855
- testexampleslm3s6965
895856
- testexampleshifive1
896857
- testexamplesesp32c3

0 commit comments

Comments
 (0)