From d0c41bd5bc3830ab42135ecd2f6300ed1cc06aae Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 6 Feb 2024 12:44:15 -0800 Subject: [PATCH] ci: Add a registry cache for git protocol --- .github/workflows/ci.yaml | 9 +++++++++ .github/workflows/master.yaml | 5 +++++ .github/workflows/pr.yaml | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 72b510429..890399522 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,11 @@ jobs: ] steps: - uses: actions/checkout@v3 + - uses: actions/cache@v4 + if: startsWith(matrix.rust, '1') + with: + path: ~/.cargo/registry/index + key: cargo-${{ matrix.rust }}-git-index - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} @@ -40,6 +45,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/cache@v4 + with: + path: ~/.cargo/registry/index + key: cargo-1.31.0-git-index - uses: dtolnay/rust-toolchain@1.31.0 with: target: thumbv6m-none-eabi diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index 98e8f8e09..6b7a4cb80 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -16,6 +16,11 @@ jobs: rust: [1.31.0, stable] steps: - uses: actions/checkout@v3 + - uses: actions/cache@v4 + if: startsWith(matrix.rust, '1') + with: + path: ~/.cargo/registry/index + key: cargo-${{ matrix.rust }}-git-index - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index eb013bbcc..303e5039c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,6 +12,11 @@ jobs: rust: [1.31.0, stable] steps: - uses: actions/checkout@v3 + - uses: actions/cache@v4 + if: startsWith(matrix.rust, '1') + with: + path: ~/.cargo/registry/index + key: cargo-${{ matrix.rust }}-git-index - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }}