Skip to content

Commit f187293

Browse files
bors[bot]burrbull
andauthored
Merge #686
686: simplify ci strategy r=Emilgardis a=burrbull Co-authored-by: Andrey Zgarbul <[email protected]>
2 parents 5e50d6b + 58666b2 commit f187293

File tree

3 files changed

+33
-54
lines changed

3 files changed

+33
-54
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,35 @@ jobs:
4646
needs: [check]
4747
strategy:
4848
matrix:
49-
# All generated code should be running on stable now
50-
rust: [stable]
51-
52-
# All vendor files we want to test on stable
53-
vendor: [Atmel, Freescale, Fujitsu, GD32, Holtek, Microchip, Nordic, Nuvoton, NXP, RISC-V, SiliconLabs, Spansion, STMicro, Toshiba]
54-
5549
# Options are all, none, strict and const
56-
options: [all, none]
57-
exclude:
58-
- vendor: Fujitsu
59-
options: all
60-
- vendor: Spansion
61-
options: all
62-
- vendor: STMicro
63-
options: all
64-
- vendor: Nuvoton
65-
options: all
66-
- vendor: Microchip
67-
options: all
68-
- vendor: RISC-V
69-
options: all
7050
include:
51+
- { rust: stable, vendor: Atmel, options: all }
52+
- { rust: stable, vendor: Atmel, options: "" }
53+
- { rust: stable, vendor: Freescale, options: all }
54+
- { rust: stable, vendor: Freescale, options: "" }
55+
- { rust: stable, vendor: Fujitsu, options: "" }
56+
- { rust: stable, vendor: GD32, options: all }
57+
- { rust: stable, vendor: GD32, options: "" }
58+
- { rust: stable, vendor: Holtek, options: all }
59+
- { rust: stable, vendor: Holtek, options: "" }
60+
- { rust: stable, vendor: Microchip, options: "" }
61+
- { rust: stable, vendor: Nordic, options: all }
62+
- { rust: stable, vendor: Nordic, options: "" }
63+
- { rust: stable, vendor: Nuvoton, options: "" }
64+
- { rust: stable, vendor: NXP, options: all }
65+
- { rust: stable, vendor: NXP, options: "" }
66+
- { rust: stable, vendor: RISC-V, options: "" }
67+
- { rust: stable, vendor: SiliconLabs, options: all }
68+
- { rust: stable, vendor: SiliconLabs, options: "" }
69+
- { rust: stable, vendor: Spansion, options: "" }
70+
- { rust: stable, vendor: STMicro, options: "" }
71+
- { rust: stable, vendor: Toshiba, options: all }
72+
- { rust: stable, vendor: Toshiba, options: "" }
7173
# Test MSRV
72-
- rust: 1.60.0
73-
vendor: Nordic
74-
75-
# Use nightly for architectures which don't support stable
76-
- rust: nightly
77-
vendor: OTHER
78-
74+
- { rust: 1.60.0, vendor: Nordic, options: "" }
7975
# Use nightly for architectures which don't support stable
80-
- rust: nightly
81-
vendor: Espressif
76+
- { rust: nightly, vendor: OTHER, options: "" }
77+
- { rust: nightly, vendor: Espressif, options: "" }
8278

8379
steps:
8480
- uses: actions/checkout@v3
@@ -125,7 +121,7 @@ jobs:
125121
- name: Run CI script
126122
env:
127123
VENDOR: RISC-V
128-
OPTIONS: all
124+
OPTIONS: ""
129125
COMMAND: clippy
130126
run: bash ci/script.sh
131127

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
- simplify ci strategy
11+
1012
## [v0.27.1] - 2022-10-25
1113

1214
- fix cli error with --help/version

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)