Browse Source

feat: add rust-cache to all Rust workflows (#2355)

- Added Swatinem/rust-cache@v2 to all workflows that run Rust commands
- Configured workspace paths for each workflow
- Maintains existing workflow functionality while adding caching

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Jayant Krishnamurthy <jayant@dourolabs.xyz>
devin-ai-integration[bot] 9 months ago
parent
commit
bf76176b84

+ 3 - 0
.github/workflows/ci-fuel-contract.yml

@@ -21,6 +21,9 @@ jobs:
         working-directory: target_chains/fuel/contracts/
     steps:
       - uses: actions/checkout@v2
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "target_chains/fuel/contracts -> target"
       - name: Install Fuel toolchain
         run: |
           curl https://install.fuel.network | sh

+ 3 - 0
.github/workflows/ci-hermes-server.yml

@@ -11,6 +11,9 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "apps/hermes/server -> target"
       - uses: actions-rs/toolchain@v1
         with:
           profile: minimal

+ 3 - 0
.github/workflows/ci-lazer-rust.yml

@@ -23,6 +23,9 @@ jobs:
       - uses: actions-rust-lang/setup-rust-toolchain@v1
         with:
           toolchain: 1.81.0
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "lazer -> target"
       - name: Install Foundry
         uses: foundry-rs/foundry-toolchain@v1
       - name: install extra tools

+ 3 - 0
.github/workflows/ci-near-contract.yml

@@ -36,6 +36,9 @@ jobs:
         working-directory: target_chains/near/receiver
     steps:
       - uses: actions/checkout@v2
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "target_chains/near/receiver -> target"
       - run: sudo apt-get install -y libudev-dev
       - run: cargo +stable install --locked cargo-near@0.13.3
       - run: cargo near build reproducible-wasm

+ 3 - 0
.github/workflows/ci-remote-executor.yml

@@ -18,6 +18,9 @@ jobs:
           toolchain: 1.73.0
           components: rustfmt, clippy
           override: true
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "governance/remote_executor -> target"
       - name: Install Solana
         run: |
           sh -c "$(curl -sSfL https://release.solana.com/v1.18.23/install)"

+ 3 - 0
.github/workflows/ci-starknet-tools.yml

@@ -18,6 +18,9 @@ jobs:
           components: rustfmt, clippy
           override: true
       - uses: actions/checkout@v3
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "target_chains/starknet/tools/test_vaas -> target"
       - name: Install Scarb
         uses: software-mansion/setup-scarb@v1
         with:

+ 3 - 0
.github/workflows/ci-stylus-nostd.yml

@@ -37,6 +37,9 @@ jobs:
         with:
           toolchain: stable
           rustflags: ""
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "target_chains/ethereum/sdk/stylus -> target"
       - name: Add rust targets ${{ matrix.target }}
         run: rustup target add ${{ matrix.target }}
       - name: Cargo check

+ 3 - 0
.github/workflows/ci-sui-contract.yml

@@ -19,6 +19,9 @@ jobs:
         working-directory: target_chains/sui/contracts/
     steps:
       - uses: actions/checkout@v3
+      - uses: Swatinem/rust-cache@v2
+        with:
+          workspaces: "target_chains/sui/contracts -> target"
 
       - name: Update rust
         run: rustup update stable