Skip to content

Commit 58666b2

Browse files
committed
pass options directly
1 parent fac2c56 commit 58666b2

File tree

2 files changed

+23
-42
lines changed

2 files changed

+23
-42
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,32 @@ jobs:
4949
# Options are all, none, strict and const
5050
include:
5151
- { rust: stable, vendor: Atmel, options: all }
52-
- { rust: stable, vendor: Atmel, options: none }
52+
- { rust: stable, vendor: Atmel, options: "" }
5353
- { rust: stable, vendor: Freescale, options: all }
54-
- { rust: stable, vendor: Freescale, options: none }
55-
- { rust: stable, vendor: Fujitsu, options: none }
54+
- { rust: stable, vendor: Freescale, options: "" }
55+
- { rust: stable, vendor: Fujitsu, options: "" }
5656
- { rust: stable, vendor: GD32, options: all }
57-
- { rust: stable, vendor: GD32, options: none }
57+
- { rust: stable, vendor: GD32, options: "" }
5858
- { rust: stable, vendor: Holtek, options: all }
59-
- { rust: stable, vendor: Holtek, options: none }
60-
- { rust: stable, vendor: Microchip, options: none }
59+
- { rust: stable, vendor: Holtek, options: "" }
60+
- { rust: stable, vendor: Microchip, options: "" }
6161
- { rust: stable, vendor: Nordic, options: all }
62-
- { rust: stable, vendor: Nordic, options: none }
63-
- { rust: stable, vendor: Nuvoton, options: none }
62+
- { rust: stable, vendor: Nordic, options: "" }
63+
- { rust: stable, vendor: Nuvoton, options: "" }
6464
- { rust: stable, vendor: NXP, options: all }
65-
- { rust: stable, vendor: NXP, options: none }
66-
- { rust: stable, vendor: RISC-V, options: none }
65+
- { rust: stable, vendor: NXP, options: "" }
66+
- { rust: stable, vendor: RISC-V, options: "" }
6767
- { rust: stable, vendor: SiliconLabs, options: all }
68-
- { rust: stable, vendor: SiliconLabs, options: none }
69-
- { rust: stable, vendor: Spansion, options: none }
70-
- { rust: stable, vendor: STMicro, options: none }
68+
- { rust: stable, vendor: SiliconLabs, options: "" }
69+
- { rust: stable, vendor: Spansion, options: "" }
70+
- { rust: stable, vendor: STMicro, options: "" }
7171
- { rust: stable, vendor: Toshiba, options: all }
72-
- { rust: stable, vendor: Toshiba, options: none }
72+
- { rust: stable, vendor: Toshiba, options: "" }
7373
# Test MSRV
74-
- { rust: 1.60.0, vendor: Nordic, options: none }
74+
- { rust: 1.60.0, vendor: Nordic, options: "" }
7575
# Use nightly for architectures which don't support stable
76-
- { rust: nightly, vendor: OTHER, options: none }
77-
- { rust: nightly, vendor: Espressif, options: none }
76+
- { rust: nightly, vendor: OTHER, options: "" }
77+
- { rust: nightly, vendor: Espressif, options: "" }
7878

7979
steps:
8080
- uses: actions/checkout@v3
@@ -121,7 +121,7 @@ jobs:
121121
- name: Run CI script
122122
env:
123123
VENDOR: RISC-V
124-
OPTIONS: all
124+
OPTIONS: ""
125125
COMMAND: clippy
126126
run: bash ci/script.sh
127127

ci/script.sh

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test_svd() {
99

1010
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
1111
pushd $td
12-
RUST_BACKTRACE=1 svd2rust $strict $const_generic $derive_more -i ${1}.svd
12+
RUST_BACKTRACE=1 svd2rust $options -i ${1}.svd
1313

1414
mv lib.rs src/lib.rs
1515

@@ -23,7 +23,7 @@ test_svd_for_target() {
2323

2424
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
2525
pushd $td
26-
RUST_BACKTRACE=1 svd2rust --target $1 -i input.svd
26+
RUST_BACKTRACE=1 svd2rust $options --target $1 -i input.svd
2727

2828
mv lib.rs src/lib.rs
2929

@@ -41,29 +41,10 @@ main() {
4141

4242
case $OPTIONS in
4343
all)
44-
const_generic="--const_generic"
45-
strict="--strict"
46-
derive_more="--derive_more"
47-
;;
48-
strict)
49-
const_generic=""
50-
strict="--strict"
51-
derive_more=""
52-
;;
53-
const)
54-
const_generic="--const_generic"
55-
strict=""
56-
derive_more=""
57-
;;
58-
derive_more)
59-
const_generic=""
60-
strict=""
61-
derive_more="--derive_more"
44+
options="--const_generic --strict --derive_more"
6245
;;
6346
*)
64-
const_generic=""
65-
strict=""
66-
derive_more=""
47+
options=$OPTIONS
6748
;;
6849
esac
6950

@@ -72,7 +53,7 @@ main() {
7253
echo 'cortex-m = "0.7.4"' >> $td/Cargo.toml
7354
echo 'cortex-m-rt = "0.7.1"' >> $td/Cargo.toml
7455
echo 'vcell = "0.1.3"' >> $td/Cargo.toml
75-
if [ $derive_more ]; then
56+
if [[ "$options" == *"--derive_more"* ]]; then
7657
echo 'derive_more = "0.99"' >> $td/Cargo.toml
7758
fi
7859
echo '[profile.dev]' >> $td/Cargo.toml

0 commit comments

Comments
 (0)