77name : Build Verification
88
99jobs :
10- formatting :
11- name : Check for Formatting Issues
10+ build_environment :
11+ name : Build Environment Setup
1212 runs-on : ubuntu-latest
1313 steps :
1414 - uses : actions/checkout@v2
1515 - name : Setup Rust Environment
1616 uses : ./.github/actions/setup-rust-environment/
1717 with :
1818 embedded : true
19- cargo-dependencies : " cargo-make cargo-fmt"
19+ cache-key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
20+ formatting :
21+ name : Check for Formatting Issues
22+ needs : build_environment
23+ runs-on : ubuntu-latest
24+ steps :
25+ - name : Checkout
26+ uses : actions/checkout@v2
27+
28+ - name : Restore Rust Environment Cache
29+ uses : ./.github/actions/restore-environment-cache/
30+ with :
31+ cache-key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
32+
2033 - name : Check Formatting
2134 run : cargo fmt -- --check
2235
2336 build_pressure :
2437 name : Build with Pressure Feature
38+ needs : build_environment
2539 runs-on : ubuntu-latest
2640 steps :
2741 - name : Checkout
2842 uses : actions/checkout@v2
2943
30- - name : Setup Rust Environment
31- uses : ./.github/actions/setup-rust- environment/
44+ - name : Restore Rust Environment Cache
45+ uses : ./.github/actions/restore- environment-cache /
3246 with :
33- embedded : true
34- cargo-dependencies : " cargo-make"
47+ cache-key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3548
3649 - name : " Build with Pressure Feature"
3750 uses : actions-rs/cargo@v1
@@ -41,16 +54,16 @@ jobs:
4154
4255 build_temperature :
4356 name : Build with Temperature Feature
57+ needs : build_environment
4458 runs-on : ubuntu-latest
4559 steps :
4660 - name : Checkout
4761 uses : actions/checkout@v2
4862
49- - name : Setup Rust Environment
50- uses : ./.github/actions/setup-rust- environment/
63+ - name : Restore Rust Environment Cache
64+ uses : ./.github/actions/restore- environment-cache /
5165 with :
52- embedded : true
53- cargo-dependencies : " cargo-make"
66+ cache-key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
5467
5568 - name : " Build with Temperature Feature"
5669 uses : actions-rs/cargo@v1
@@ -60,16 +73,16 @@ jobs:
6073
6174 build_strain :
6275 name : Build with Strain Feature
76+ needs : build_environment
6377 runs-on : ubuntu-latest
6478 steps :
6579 - name : Checkout
6680 uses : actions/checkout@v2
6781
68- - name : Setup Rust Environment
69- uses : ./.github/actions/setup-rust- environment/
82+ - name : Restore Rust Environment Cache
83+ uses : ./.github/actions/restore- environment-cache /
7084 with :
71- embedded : true
72- cargo-dependencies : " cargo-make"
85+ cache-key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
7386
7487 - name : " Build with Strain Feature"
7588 uses : actions-rs/cargo@v1
@@ -78,15 +91,19 @@ jobs:
7891 args : --release --features strain
7992
8093 test :
94+ name : Run Host Tests
95+ needs : build_environment
8196 runs-on : ubuntu-latest
8297 env :
8398 RUST_MIN_STACK : 8388608
8499 steps :
85100 - name : Checkout
86101 uses : actions/checkout@v2
87102
88- - name : Setup Rust Environment
89- uses : ./.github/actions/setup-rust-environment/
103+ - name : Restore Rust Environment Cache
104+ uses : ./.github/actions/restore-environment-cache/
105+ with :
106+ cache-key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
90107
91108 - uses : actions-rs/cargo@v1
92109 name : " Run Host Tests"
0 commit comments