Skip to content

Commit d8a4fee

Browse files
authored
parallelize CI (#11)
1 parent 3eef229 commit d8a4fee

File tree

1 file changed

+90
-11
lines changed

1 file changed

+90
-11
lines changed

.github/workflows/rust.yml

Lines changed: 90 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
CARGO_TERM_COLOR: always
1212

1313
jobs:
14-
build:
14+
msrv:
1515

1616
runs-on: ubuntu-latest
1717

@@ -21,13 +21,23 @@ jobs:
2121
with:
2222
profile: minimal
2323
toolchain: nightly
24-
override: true
2524
target: thumbv7em-none-eabihf
26-
components: clippy, rustfmt
2725

2826
- name: Checkout Sources
2927
uses: actions/checkout@v2
3028

29+
- name: Cache Cargo Dependencies
30+
uses: actions/cache@v2
31+
with:
32+
path: |
33+
- ~/.cargo/bin/
34+
- ~/.cargo/registry/index/
35+
- ~/.cargo/registry/cache/
36+
- ~/.cargo/git/db/
37+
key: ${{ runner.OS }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
38+
restore-keys: |
39+
${{ runner.OS }}-cargo-msrv
40+
3141
- name: install cargo-msrv
3242
uses: actions-rs/install@v0.1
3343
with:
@@ -42,21 +52,90 @@ jobs:
4252
cargo msrv --verify --path ./ep-systick -- cargo check
4353
cargo msrv --verify --path ./ep-dwt -- cargo check
4454
45-
- name: Check Formatting
46-
run: cargo fmt --check
55+
build:
56+
57+
runs-on: ubuntu-latest
58+
env:
59+
CARGO_BUILD_TARGET: thumbv7em-none-eabihf
60+
RUSTFLAGS: -D warnings
61+
62+
steps:
63+
- name: Install Rust (thumbv7em)
64+
uses: actions-rs/toolchain@v1
65+
with:
66+
profile: minimal
67+
toolchain: nightly
68+
override: true
69+
target: thumbv7em-none-eabihf
70+
71+
- name: Checkout Sources
72+
uses: actions/checkout@v2
73+
74+
- name: Cache Cargo Dependencies
75+
uses: actions/cache@v2
76+
with:
77+
path: |
78+
- ~/.cargo/bin/
79+
- ~/.cargo/registry/index/
80+
- ~/.cargo/registry/cache/
81+
- ~/.cargo/git/db/
82+
key: ${{ runner.OS }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
83+
restore-keys: |
84+
${{ runner.OS }}-cargo-build
85+
86+
- name: Cache Build Output Dependencies
87+
uses: actions/cache@v2
88+
with:
89+
path: target
90+
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
91+
restore-keys: |
92+
${{ runner.OS }}-build-
4793
4894
- name: Build (default)
49-
env:
50-
CARGO_BUILD_TARGET: thumbv7em-none-eabihf
51-
RUSTFLAGS: -D warnings
5295
run: cargo build
5396

5497
- name: Build (all features)
55-
env:
56-
CARGO_BUILD_TARGET: thumbv7em-none-eabihf
57-
RUSTFLAGS: -D warnings
5898
run: cargo build --all-features
5999

100+
test:
101+
runs-on: ubuntu-latest
102+
103+
steps:
104+
- name: Install Rust (thumbv7em)
105+
uses: actions-rs/toolchain@v1
106+
with:
107+
profile: minimal
108+
toolchain: nightly
109+
override: true
110+
target: thumbv7em-none-eabihf
111+
components: clippy, rustfmt
112+
113+
- name: Checkout Sources
114+
uses: actions/checkout@v2
115+
116+
- name: Cache Cargo Dependencies
117+
uses: actions/cache@v2
118+
with:
119+
path: |
120+
- ~/.cargo/bin/
121+
- ~/.cargo/registry/index/
122+
- ~/.cargo/registry/cache/
123+
- ~/.cargo/git/db/
124+
key: ${{ runner.OS }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
125+
restore-keys: |
126+
${{ runner.OS }}-cargo-test
127+
128+
- name: Cache Build Output Dependencies
129+
uses: actions/cache@v2
130+
with:
131+
path: target
132+
key: ${{ runner.OS }}-test-${{ hashFiles('**/Cargo.lock') }}
133+
restore-keys: |
134+
${{ runner.OS }}-test
135+
136+
- name: Check Formatting
137+
run: cargo fmt --check
138+
60139
- name: test all crates
61140
env:
62141
RUSTFLAGS: -D warnings

0 commit comments

Comments
 (0)