Skip to content

Commit 7d9454e

Browse files
fix: gh actions caching
1 parent 0bcbc3c commit 7d9454e

3 files changed

Lines changed: 19 additions & 56 deletions

File tree

.github/actions/restore-environment-cache/action.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/actions/setup-rust-environment/action.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# to take advantage of caching and other features they provide. It runs faster with the vendor actions.
33
name: Setup Rust Environment
44
description: Install deps, ARM toolchain, and Rust toolchain
5-
inputs:
6-
cache-key:
7-
description: The key to use for caching the Rust environment
8-
required: true
95

106
runs:
117
using: composite
@@ -23,7 +19,6 @@ runs:
2319

2420
- name: Install Rust Toolchain for Embedded Development
2521
uses: actions-rs/toolchain@v1
26-
if: ${{ inputs.embedded == 'true' }}
2722
with:
2823
toolchain: stable
2924
target: thumbv7em-none-eabihf
@@ -44,4 +39,4 @@ runs:
4439
~/.cargo/registry/cache/
4540
~/.cargo/git/db/
4641
target/
47-
key: ${{ inputs.cache-key }}
42+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

.github/workflows/build.yml

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,38 @@ on:
77
name: Build Verification
88

99
jobs:
10-
build_environment:
11-
name: Build Environment Setup
10+
setup_environment:
11+
name: Setup Environment
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Setup Rust Environment
1616
uses: ./.github/actions/setup-rust-environment/
17-
with:
18-
embedded: true
19-
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
17+
2018
formatting:
2119
name: Check for Formatting Issues
22-
needs: build_environment
20+
needs: setup_environment
2321
runs-on: ubuntu-latest
2422
steps:
2523
- name: Checkout
2624
uses: actions/checkout@v2
2725

28-
- name: Restore Rust Environment Cache
29-
uses: ./.github/actions/restore-environment-cache/
30-
with:
31-
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
26+
- name: Setup Rust Environment (Cached)
27+
uses: ./.github/actions/setup-rust-environment/
3228

3329
- name: Check Formatting
3430
run: cargo fmt -- --check
3531

3632
build_pressure:
3733
name: Build with Pressure Feature
38-
needs: build_environment
34+
needs: setup_environment
3935
runs-on: ubuntu-latest
4036
steps:
4137
- name: Checkout
4238
uses: actions/checkout@v2
4339

44-
- name: Restore Rust Environment Cache
45-
uses: ./.github/actions/restore-environment-cache/
46-
with:
47-
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
40+
- name: Setup Rust Environment (Cached)
41+
uses: ./.github/actions/setup-rust-environment/
4842

4943
- name: "Build with Pressure Feature"
5044
uses: actions-rs/cargo@v1
@@ -54,16 +48,14 @@ jobs:
5448

5549
build_temperature:
5650
name: Build with Temperature Feature
57-
needs: build_environment
51+
needs: setup_environment
5852
runs-on: ubuntu-latest
5953
steps:
6054
- name: Checkout
6155
uses: actions/checkout@v2
6256

63-
- name: Restore Rust Environment Cache
64-
uses: ./.github/actions/restore-environment-cache/
65-
with:
66-
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
57+
- name: Setup Rust Environment (Cached)
58+
uses: ./.github/actions/setup-rust-environment/
6759

6860
- name: "Build with Temperature Feature"
6961
uses: actions-rs/cargo@v1
@@ -73,16 +65,14 @@ jobs:
7365

7466
build_strain:
7567
name: Build with Strain Feature
76-
needs: build_environment
68+
needs: setup_environment
7769
runs-on: ubuntu-latest
7870
steps:
7971
- name: Checkout
8072
uses: actions/checkout@v2
8173

82-
- name: Restore Rust Environment Cache
83-
uses: ./.github/actions/restore-environment-cache/
84-
with:
85-
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
74+
- name: Setup Rust Environment (Cached)
75+
uses: ./.github/actions/setup-rust-environment/
8676

8777
- name: "Build with Strain Feature"
8878
uses: actions-rs/cargo@v1
@@ -92,18 +82,16 @@ jobs:
9282

9383
test:
9484
name: Run Host Tests
95-
needs: build_environment
85+
needs: setup_environment
9686
runs-on: ubuntu-latest
9787
env:
9888
RUST_MIN_STACK: 8388608
9989
steps:
10090
- name: Checkout
10191
uses: actions/checkout@v2
10292

103-
- name: Restore Rust Environment Cache
104-
uses: ./.github/actions/restore-environment-cache/
105-
with:
106-
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
93+
- name: Setup Rust Environment (Cached)
94+
uses: ./.github/actions/setup-rust-environment/
10795

10896
- uses: actions-rs/cargo@v1
10997
name: "Run Host Tests"

0 commit comments

Comments
 (0)