aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/rust.yml160
-rwxr-xr-xci.sh50
2 files changed, 66 insertions, 144 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index de500c3a7..055089bd9 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -2,9 +2,9 @@ name: Rust
2 2
3on: 3on:
4 push: 4 push:
5 branches: [ staging, trying, master ] 5 branches: [staging, trying, master]
6 pull_request: 6 pull_request:
7 branches: [ master ] 7 branches: [master]
8 8
9env: 9env:
10 CARGO_TERM_COLOR: always 10 CARGO_TERM_COLOR: always
@@ -12,162 +12,37 @@ env:
12jobs: 12jobs:
13 all: 13 all:
14 runs-on: ubuntu-20.04 14 runs-on: ubuntu-20.04
15 needs: [build, fmt, test, metapac_gen] 15 needs: [build, test, metapac_gen]
16 steps: 16 steps:
17 - name: Done 17 - name: Done
18 run: exit 0 18 run: exit 0
19 build: 19 build:
20 runs-on: ubuntu-latest 20 runs-on: ubuntu-latest
21 strategy:
22 matrix:
23 include:
24 - package: embassy
25 target: thumbv7em-none-eabi
26 - package: embassy
27 target: thumbv7em-none-eabi
28 features: log,executor-agnostic
29 - package: embassy
30 target: thumbv7em-none-eabi
31 features: defmt
32 - package: embassy
33 target: thumbv6m-none-eabi
34 features: defmt
35
36 - package: examples/std
37 target: x86_64-unknown-linux-gnu
38
39 - package: embassy-nrf
40 target: thumbv7em-none-eabi
41 features: nrf52805
42 - package: embassy-nrf
43 target: thumbv7em-none-eabi
44 features: nrf52810
45 - package: embassy-nrf
46 target: thumbv7em-none-eabi
47 features: nrf52811
48 - package: embassy-nrf
49 target: thumbv7em-none-eabi
50 features: nrf52820
51 - package: embassy-nrf
52 target: thumbv7em-none-eabi
53 features: nrf52832
54 - package: embassy-nrf
55 target: thumbv7em-none-eabi
56 features: nrf52833
57 - package: embassy-nrf
58 target: thumbv8m.main-none-eabihf
59 features: nrf9160-s
60 - package: embassy-nrf
61 target: thumbv8m.main-none-eabihf
62 features: nrf9160-ns
63 - package: embassy-nrf
64 target: thumbv8m.main-none-eabihf
65 features: nrf5340-app-s
66 - package: embassy-nrf
67 target: thumbv8m.main-none-eabihf
68 features: nrf5340-app-ns
69 - package: embassy-nrf
70 target: thumbv8m.main-none-eabihf
71 features: nrf5340-net
72 - package: embassy-nrf
73 target: thumbv7em-none-eabi
74 features: nrf52840
75 - package: embassy-nrf
76 target: thumbv7em-none-eabi
77 features: nrf52840,log
78 - package: embassy-nrf
79 target: thumbv7em-none-eabi
80 features: nrf52840,defmt
81 - package: examples/nrf
82 target: thumbv7em-none-eabi
83
84 - package: examples/rp
85 target: thumbv6m-none-eabi
86
87 - package: embassy-stm32
88 target: thumbv7em-none-eabi
89 features: stm32f411ce,defmt
90 - package: embassy-stm32
91 target: thumbv7em-none-eabi
92 features: stm32f429zi,log
93 - package: embassy-stm32
94 target: thumbv7em-none-eabi
95 features: stm32h755zi_cm7,defmt
96 - package: embassy-stm32
97 target: thumbv7em-none-eabi
98 features: stm32l476vg,defmt
99 - package: embassy-stm32
100 target: thumbv6m-none-eabi
101 features: stm32l072cz,defmt
102 - package: embassy-stm32
103 target: thumbv7m-none-eabi
104 features: stm32l151cb-a,defmt
105 - package: examples/stm32f4
106 target: thumbv7em-none-eabi
107 - package: examples/stm32l4
108 target: thumbv7em-none-eabi
109 - package: examples/stm32h7
110 target: thumbv7em-none-eabi
111 - package: examples/stm32l0
112 target: thumbv6m-none-eabi
113 - package: examples/stm32l1
114 target: thumbv7m-none-eabi
115 - package: examples/stm32wb55
116 target: thumbv7em-none-eabihf
117 - package: examples/stm32wl55
118 target: thumbv7em-none-eabihf
119 - package: examples/stm32f0
120 target: thumbv6m-none-eabi
121 - package: examples/stm32g0
122 target: thumbv6m-none-eabi
123 - package: examples/wasm
124 target: wasm32-unknown-unknown
125 - package: examples/stm32f1
126 target: thumbv7m-none-eabi
127 - package: examples/stm32f7
128 target: thumbv7em-none-eabihf
129 - package: examples/stm32u5
130 target: thumbv7em-none-eabihf
131 steps: 21 steps:
132 - uses: actions/checkout@v2 22 - uses: actions/checkout@v2
133 with: 23 with:
134 submodules: true 24 submodules: true
135 - uses: actions-rs/toolchain@v1 25 - name: Cache multiple paths
136 with:
137 toolchain: stable
138 - name: cache
139 id: cache-target
140 uses: actions/cache@v2 26 uses: actions/cache@v2
141 with: 27 with:
142 path: target 28 path: |
143 key: ${{ runner.os }}-${{ matrix.target }} 29 ~/.cargo/bin/
144 30 ~/.cargo/registry/index/
145 # We have to append the "-D warnings" flag to .cargo/config rather than 31 ~/.cargo/registry/cache/
146 # using the RUSTFLAGS environment variable because if we set RUSTFLAGS 32 ~/.cargo/git/db/
147 # cargo will ignore the rustflags config in .cargo/config. 33 target_ci
148 - name: Check 34 key: rust3-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}
35 - name: build
149 run: | 36 run: |
150 mkdir -p .cargo 37 curl -L -o /usr/local/bin/cargo-batch https://github.com/embassy-rs/cargo-batch/releases/download/batch-0.1.0/cargo-batch
151 echo -e '[target."cfg(all())"]\nrustflags = ["-D", "warnings"]' >> .cargo/config 38 chmod +x /usr/local/bin/cargo-batch
152 cd ${{ matrix.package }} && RUSTFLAGS=-Dwarnings cargo check --features=${{ matrix.features }} --target=${{ matrix.target }} 39 ./ci.sh
153 40 rm -rf target_ci/*{,/release}/{build,deps,.fingerprint}/{lib,}{embassy,stm32}*
154 fmt:
155 runs-on: ubuntu-latest
156 steps:
157 - uses: actions/checkout@v2
158 - uses: actions-rs/toolchain@v1
159 with:
160 toolchain: stable
161 - name: Check fmt
162 run: find -name '*.rs' | xargs rustfmt --check --skip-children --unstable-features --edition 2018
163 41
164 test: 42 test:
165 runs-on: ubuntu-latest 43 runs-on: ubuntu-latest
166 steps: 44 steps:
167 - uses: actions/checkout@v2 45 - uses: actions/checkout@v2
168 - uses: actions-rs/toolchain@v1
169 with:
170 toolchain: stable
171 - name: Test 46 - name: Test
172 run: cd embassy && cargo test 47 run: cd embassy && cargo test
173 48
@@ -177,8 +52,5 @@ jobs:
177 - uses: actions/checkout@v2 52 - uses: actions/checkout@v2
178 with: 53 with:
179 submodules: true 54 submodules: true
180 - uses: actions-rs/toolchain@v1
181 with:
182 toolchain: stable
183 - name: Generate pregenerated metapac 55 - name: Generate pregenerated metapac
184 run: cd stm32-metapac-gen; cargo run --release 56 run: cd stm32-metapac-gen; cargo run --release
diff --git a/ci.sh b/ci.sh
new file mode 100755
index 000000000..601123863
--- /dev/null
+++ b/ci.sh
@@ -0,0 +1,50 @@
1#!/bin/bash
2
3set -euo pipefail
4
5export CARGO_TARGET_DIR=$PWD/target_ci
6export RUSTFLAGS=-Dwarnings
7
8find -name '*.rs' -not -path '*target*' -not -path '*stm32-metapac-gen/out/*' | xargs rustfmt --check --skip-children --unstable-features --edition 2018
9
10cargo batch \
11 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi \
12 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi --features log,executor-agnostic \
13 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi --features defmt \
14 --- build --release --manifest-path embassy/Cargo.toml --target thumbv6m-none-eabi --features defmt \
15 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52805 \
16 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52810 \
17 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811 \
18 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820 \
19 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832 \
20 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833 \
21 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s \
22 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns \
23 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s \
24 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns \
25 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net \
26 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840 \
27 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log \
28 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt \
29 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt \
30 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log \
31 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi_cm7,defmt \
32 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt \
33 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt \
34 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt \
35 --- build --release --manifest-path examples/std/Cargo.toml --target x86_64-unknown-linux-gnu --out-dir out/examples/std \
36 --- build --release --manifest-path examples/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/nrf \
37 --- build --release --manifest-path examples/rp/Cargo.toml --target thumbv6m-none-eabi --out-dir out/examples/rp \
38 --- build --release --manifest-path examples/stm32f0/Cargo.toml --target thumbv6m-none-eabi --out-dir out/examples/stm32f0 \
39 --- build --release --manifest-path examples/stm32f1/Cargo.toml --target thumbv7m-none-eabi --out-dir out/examples/stm32f1 \
40 --- build --release --manifest-path examples/stm32f4/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/stm32f4 \
41 --- build --release --manifest-path examples/stm32f7/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32f7 \
42 --- build --release --manifest-path examples/stm32g0/Cargo.toml --target thumbv6m-none-eabi --out-dir out/examples/stm32g0 \
43 --- build --release --manifest-path examples/stm32h7/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/stm32h7 \
44 --- build --release --manifest-path examples/stm32l0/Cargo.toml --target thumbv6m-none-eabi --out-dir out/examples/stm32l0 \
45 --- build --release --manifest-path examples/stm32l1/Cargo.toml --target thumbv7m-none-eabi --out-dir out/examples/stm32l1 \
46 --- build --release --manifest-path examples/stm32l4/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/stm32l4 \
47 --- build --release --manifest-path examples/stm32u5/Cargo.toml --target thumbv8m.main-none-eabihf --out-dir out/examples/stm32u5 \
48 --- build --release --manifest-path examples/stm32wb55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wb55 \
49 --- build --release --manifest-path examples/stm32wl55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wl55 \
50 --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \