Skip to content

Commit 58e31b3

Browse files
committed
FIXME: this is only to trigger CI.
change ci to use const generics and strict parsing.
1 parent 1b04a8d commit 58e31b3

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
rust: [stable]
1616

1717
# All vendor files we want to test on stable
18-
VENDOR: [rustfmt, Atmel, Freescale, Fujitsu, Holtek, Microchip, Nordic, Nuvoton, NXP, RISC-V, SiliconLabs, Spansion, STMicro, Toshiba]
18+
vendor: [rustfmt, Atmel, Freescale, Fujitsu, Holtek, Microchip, Nordic, Nuvoton, NXP, RISC-V, SiliconLabs, Spansion, STMicro, Toshiba]
1919

2020
# The default target we're compiling on and for
2121
TARGET: [x86_64-unknown-linux-gnu]
@@ -25,33 +25,35 @@ jobs:
2525

2626
FEATURES: [""]
2727

28-
OPTIONS: [""]
29-
28+
# Options are all, none, strict and const
29+
options: [all, none]
30+
exclude:
31+
- vendor: Fujitsu
32+
options: all
33+
- vendor: Spansion
34+
options: all
35+
- vendor: STMicro
36+
options: all
37+
- vendor: Nuvoton
38+
options: all
3039
include:
3140
# Test MSRV
3241
- rust: 1.46.0
33-
VENDOR: Nordic
34-
TARGET: x86_64-unknown-linux-gnu
35-
TRAVIS_OS_NAME: linux
36-
37-
# Test features
38-
- rust: 1.51.0
39-
VENDOR: RISC-V
42+
vendor: Nordic
4043
TARGET: x86_64-unknown-linux-gnu
4144
TRAVIS_OS_NAME: linux
42-
OPTIONS: "--const_generic --strict"
4345

4446
# Use nightly for architectures which don't support stable
4547
- rust: nightly
4648
experimental: true
47-
VENDOR: OTHER
49+
vendor: OTHER
4850
TARGET: x86_64-unknown-linux-gnu
4951
TRAVIS_OS_NAME: linux
5052

5153
# Use nightly for architectures which don't support stable
5254
- rust: nightly
5355
experimental: true
54-
VENDOR: Espressif
56+
vendor: Espressif
5557
TARGET: x86_64-unknown-linux-gnu
5658
TRAVIS_OS_NAME: linux
5759

@@ -74,5 +76,11 @@ jobs:
7476
target: ${{ matrix.TARGET }}
7577
override: true
7678
components: rustfmt
77-
- name: Run CI script for ${{ matrix.VENDOR }} under ${{ matrix.rust }}
78-
run: TARGET=${{ matrix.TARGET }} VENDOR=${{ matrix.VENDOR }} TRAVIS_OS_NAME=${{ matrix.TRAVIS_OS_NAME }} FEATURES=${{ matrix.FEATURES }} OPTIONS=${{ matrix.OPTIONS }} bash ci/script.sh
79+
- name: Run CI script for `${{ matrix.vendor }}` under rust `${{ matrix.rust }}` with options=`${{ matrix.options }}`
80+
env:
81+
TARGET: ${{ matrix.TARGET }}
82+
VENDOR: ${{ matrix.vendor }}
83+
FEATURES: ${{ matrix.FEATURES }}
84+
OPTIONS: ${{ matrix.options }}
85+
TRAVIS_OS_NAME: ${{ matrix.TRAVIS_OS_NAME }}
86+
run: bash ci/script.sh

ci/script.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test_svd() {
1010
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
1111
local cwd=$(pwd)
1212
pushd $td
13-
RUST_BACKTRACE=1 $cwd/target/$TARGET/release/svd2rust -i $OPTIONS ${1}.svd
13+
RUST_BACKTRACE=1 $cwd/target/$TARGET/release/svd2rust $strict $const_generic -i ${1}.svd
1414

1515
mv lib.rs src/lib.rs
1616

@@ -70,6 +70,25 @@ main() {
7070
;;
7171
esac
7272

73+
case $OPTIONS in
74+
all)
75+
const_generic="--const_generic"
76+
strict="--strict"
77+
;;
78+
strict)
79+
const_generic=""
80+
strict="--strict"
81+
;;
82+
const)
83+
const_generic="--const_generic"
84+
strict=""
85+
;;
86+
*)
87+
const_generic=""
88+
strict=""
89+
;;
90+
esac
91+
7392
# test crate
7493
cargo init --name foo $td
7594
echo 'cortex-m = "0.7.0"' >> $td/Cargo.toml

0 commit comments

Comments
 (0)