Skip to content

Commit 5a30302

Browse files
committed
change ci to use const generics and strict parsing
also merges CI to one status check
1 parent 1b04a8d commit 5a30302

File tree

3 files changed

+51
-32
lines changed

3 files changed

+51
-32
lines changed

.github/bors.toml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@ block_labels = ["needs-decision", "S-waiting-on-team"]
22
delete_merged_branches = true
33
required_approvals = 1
44
status = [
5-
"ci-linux (stable, rustfmt, x86_64-unknown-linux-gnu, linux)",
6-
"ci-linux (stable, Atmel, x86_64-unknown-linux-gnu, linux)",
7-
"ci-linux (stable, Freescale, x86_64-unknown-linux-gnu, linux)",
8-
"ci-linux (stable, Fujitsu, x86_64-unknown-linux-gnu, linux)",
9-
"ci-linux (stable, Holtek, x86_64-unknown-linux-gnu, linux)",
10-
"ci-linux (stable, Nordic, x86_64-unknown-linux-gnu, linux)",
11-
"ci-linux (stable, Nuvoton, x86_64-unknown-linux-gnu, linux)",
12-
"ci-linux (stable, NXP, x86_64-unknown-linux-gnu, linux)",
13-
"ci-linux (stable, RISC-V, x86_64-unknown-linux-gnu, linux)",
14-
"ci-linux (stable, SiliconLabs, x86_64-unknown-linux-gnu, linux)",
15-
"ci-linux (stable, Spansion, x86_64-unknown-linux-gnu, linux)",
16-
"ci-linux (stable, STMicro, x86_64-unknown-linux-gnu, linux)",
17-
"ci-linux (stable, Toshiba, x86_64-unknown-linux-gnu, linux)",
18-
"ci-linux (1.46.0, Nordic, x86_64-unknown-linux-gnu, linux)",
19-
"ci-linux (stable, x86_64-apple-darwin, osx)",
20-
"ci-linux (stable, x86_64-pc-windows-msvc, windows)",
5+
"CI",
216
]
227
timeout_sec = 14400

.github/workflows/ci.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
name: Continuous integration
77

88
jobs:
9+
ci:
10+
name: CI
11+
runs-on: ubuntu-latest
12+
needs: [ci-linux]
13+
steps:
14+
- name: Done
15+
run: exit 0
916
ci-linux:
1017
runs-on: ubuntu-latest
1118
strategy:
@@ -15,7 +22,7 @@ jobs:
1522
rust: [stable]
1623

1724
# 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]
25+
vendor: [rustfmt, Atmel, Freescale, Fujitsu, Holtek, Microchip, Nordic, Nuvoton, NXP, RISC-V, SiliconLabs, Spansion, STMicro, Toshiba]
1926

2027
# The default target we're compiling on and for
2128
TARGET: [x86_64-unknown-linux-gnu]
@@ -25,33 +32,35 @@ jobs:
2532

2633
FEATURES: [""]
2734

28-
OPTIONS: [""]
29-
35+
# Options are all, none, strict and const
36+
options: [all, none]
37+
exclude:
38+
- vendor: Fujitsu
39+
options: all
40+
- vendor: Spansion
41+
options: all
42+
- vendor: STMicro
43+
options: all
44+
- vendor: Nuvoton
45+
options: all
3046
include:
3147
# Test MSRV
3248
- 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
49+
vendor: Nordic
4050
TARGET: x86_64-unknown-linux-gnu
4151
TRAVIS_OS_NAME: linux
42-
OPTIONS: "--const_generic --strict"
4352

4453
# Use nightly for architectures which don't support stable
4554
- rust: nightly
4655
experimental: true
47-
VENDOR: OTHER
56+
vendor: OTHER
4857
TARGET: x86_64-unknown-linux-gnu
4958
TRAVIS_OS_NAME: linux
5059

5160
# Use nightly for architectures which don't support stable
5261
- rust: nightly
5362
experimental: true
54-
VENDOR: Espressif
63+
vendor: Espressif
5564
TARGET: x86_64-unknown-linux-gnu
5665
TRAVIS_OS_NAME: linux
5766

@@ -74,5 +83,11 @@ jobs:
7483
target: ${{ matrix.TARGET }}
7584
override: true
7685
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
86+
- name: Run CI script for `${{ matrix.vendor }}` under rust `${{ matrix.rust }}` with options=`${{ matrix.options }}`
87+
env:
88+
TARGET: ${{ matrix.TARGET }}
89+
VENDOR: ${{ matrix.vendor }}
90+
FEATURES: ${{ matrix.FEATURES }}
91+
OPTIONS: ${{ matrix.options }}
92+
TRAVIS_OS_NAME: ${{ matrix.TRAVIS_OS_NAME }}
93+
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)