Skip to content

Commit a5bfeb8

Browse files
committed
ci: Split out major versions, add v2
1 parent 550952d commit a5bfeb8

File tree

1 file changed

+85
-34
lines changed

1 file changed

+85
-34
lines changed

.github/workflows/build.yml

Lines changed: 85 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v3
2121

22-
- name: Install all Rust targets
23-
run: rustup target install thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabihf
22+
- name: Configure Rust target (v6, v7, v8.b v8.m)
23+
run: |
24+
rustup target add thumbv6m-none-eabi
25+
rustup target add thumbv7m-none-eabi
26+
rustup target add thumbv7em-none-eabihf
27+
rustup target add thumbv8m.base-none-eabi
28+
rustup target add thumbv8m.main-none-eabi
2429
2530
- name: cargo fmt --check
2631
run: find . -type f -name Cargo.toml -execdir cargo fmt --check --manifest-path {} +
@@ -29,76 +34,123 @@ jobs:
2934
check:
3035
name: check
3136
runs-on: ubuntu-22.04
37+
strategy:
38+
matrix:
39+
rticversion:
40+
- v0.5
41+
- v1
42+
- v2
3243
steps:
3344
- name: Checkout
3445
uses: actions/checkout@v3
3546

3647
- name: Cache Dependencies
3748
uses: Swatinem/rust-cache@v2
3849

39-
- name: Install all Rust targets
40-
run: rustup target install thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabihf
50+
- name: Install Rust nightly
51+
run: |
52+
rustup toolchain install nightly
53+
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
54+
55+
- name: Configure Rust target (v6, v7, v8.b v8.m)
56+
run: |
57+
rustup target add thumbv6m-none-eabi
58+
rustup target add thumbv7m-none-eabi
59+
rustup target add thumbv7em-none-eabihf
60+
rustup target add thumbv8m.base-none-eabi
61+
rustup target add thumbv8m.main-none-eabi
62+
63+
- name: Install flip-link
64+
run: cargo install flip-link
4165

4266
- name: cargo check
43-
run: find . -type f -name Cargo.toml -execdir cargo check --target-dir /tmp/build --manifest-path {} +
67+
if: ${{ matrix.rticversion != 'v2' }}
68+
run: find rtic_${{ matrix.rticversion }} -type f -name Cargo.toml -execdir cargo build --release --manifest-path {} +
69+
70+
- name: cargo check
71+
if: ${{ matrix.rticversion == 'v2' }}
72+
run: find rtic_${{ matrix.rticversion }} -type f -name Cargo.toml -execdir cargo +nightly build --release --manifest-path {} +
4473

4574
# Clippy
4675
clippy:
4776
name: Cargo clippy
4877
runs-on: ubuntu-22.04
78+
strategy:
79+
matrix:
80+
rticversion:
81+
- v0.5
82+
- v1
83+
- v2
84+
4985
steps:
5086
- name: Checkout
5187
uses: actions/checkout@v3
5288

5389
- name: Cache Dependencies
5490
uses: Swatinem/rust-cache@v2
5591

56-
- name: Install all Rust targets
57-
run: rustup target install thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabihf
58-
59-
- name: cargo clippy
60-
run: find . -type f -name Cargo.toml -execdir cargo clippy --target-dir /tmp/build --manifest-path {} +
92+
- name: Install Rust nightly
93+
run: |
94+
rustup toolchain install nightly
95+
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
6196
97+
- name: Configure Rust target (v6, v7, v8.b v8.m)
98+
run: |
99+
rustup target add thumbv6m-none-eabi
100+
rustup target add thumbv7m-none-eabi
101+
rustup target add thumbv7em-none-eabihf
102+
rustup target add thumbv8m.base-none-eabi
103+
rustup target add thumbv8m.main-none-eabi
62104
63-
# Compilation
64-
buildv0_5:
65-
name: build v0.5
66-
runs-on: ubuntu-22.04
67-
steps:
68-
- name: Checkout
69-
uses: actions/checkout@v3
70-
71-
- name: Cache Dependencies
72-
uses: Swatinem/rust-cache@v2
105+
- name: cargo clippy
106+
if: ${{ matrix.rticversion != 'v2' }}
107+
run: find rtic_${{ matrix.rticversion }} -type f -name Cargo.toml -execdir cargo clippy --target-dir /tmp/build --manifest-path {} +
73108

74-
- name: Install all Rust targets
75-
run: rustup target install thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabihf
76-
77-
- name: Install flip-link
78-
run: cargo install flip-link
109+
- name: cargo clippy
110+
if: ${{ matrix.rticversion == 'v2' }}
111+
run: find rtic_${{ matrix.rticversion }} -type f -name Cargo.toml -execdir cargo +nightly clippy --target-dir /tmp/build --manifest-path {} +
79112

80-
- name: cargo build
81-
run: find rtic_v0.5 -type f -name Cargo.toml -execdir cargo build --release --manifest-path {} +
82113

83114
# Compilation
84-
buildv1:
85-
name: build v1
115+
build:
116+
name: build
86117
runs-on: ubuntu-22.04
118+
strategy:
119+
matrix:
120+
rticversion:
121+
- v0.5
122+
- v1
123+
- v2
87124
steps:
88125
- name: Checkout
89126
uses: actions/checkout@v3
90127

91128
- name: Cache Dependencies
92129
uses: Swatinem/rust-cache@v2
93130

94-
- name: Install all Rust targets
95-
run: rustup target install thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabihf
131+
- name: Install Rust nightly
132+
run: |
133+
rustup toolchain install nightly
134+
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
135+
136+
- name: Configure Rust target (v6, v7, v8.b v8.m)
137+
run: |
138+
rustup target add thumbv6m-none-eabi
139+
rustup target add thumbv7m-none-eabi
140+
rustup target add thumbv7em-none-eabihf
141+
rustup target add thumbv8m.base-none-eabi
142+
rustup target add thumbv8m.main-none-eabi
96143
97144
- name: Install flip-link
98145
run: cargo install flip-link
99146

100147
- name: cargo build
101-
run: find rtic_v1 -type f -name Cargo.toml -execdir cargo build --release --manifest-path {} +
148+
if: ${{ matrix.rticversion != 'v2' }}
149+
run: find rtic_${{ matrix.rticversion }} -type f -name Cargo.toml -execdir cargo build --release --manifest-path {} +
150+
151+
- name: cargo build
152+
if: ${{ matrix.rticversion == 'v2' }}
153+
run: find rtic_${{ matrix.rticversion }} -type f -name Cargo.toml -execdir cargo +nightly build --release --manifest-path {} +
102154

103155
check-dependabot-config:
104156
name: Ensure that `dependabot.yml` is up to date
@@ -122,8 +174,7 @@ jobs:
122174
- style
123175
- check
124176
- clippy
125-
- buildv0_5
126-
- buildv1
177+
- build
127178
- check-dependabot-config
128179
runs-on: ubuntu-22.04
129180
steps:

0 commit comments

Comments
 (0)