From 2539a63b2c262aeca5894eee09ee766b593da1f5 Mon Sep 17 00:00:00 2001 From: Josh Comer Date: Fri, 3 Mar 2023 11:50:57 -0400 Subject: [PATCH 1/2] Add caching to github workflows --- .github/workflows/ci.yml | 6 +++++- .github/workflows/publish.yml | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30fe4ed..215312d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -79,6 +79,8 @@ jobs: target: ${{ matrix.target }} profile: minimal components: clippy + - name: Rust Cache + uses: Swatinem/rust-cache@v2.2.1 - name: Install Cross uses: actions-rs/install@v0.1 with: @@ -117,6 +119,8 @@ jobs: default: true profile: minimal components: rustfmt + - name: Rust Cache + uses: Swatinem/rust-cache@v2.2.1 - name: Format uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0bb15e..7ff989b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -65,13 +65,15 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: stable target: ${{ matrix.target }} profile: minimal + - name: Rust Cache + uses: Swatinem/rust-cache@v2.2.1 - name: Archive Release uses: taiki-e/upload-rust-binary-action@v1 with: From 15188c785f664dcde7b1d575553035826d9b5d8e Mon Sep 17 00:00:00 2001 From: Josh Comer Date: Fri, 3 Mar 2023 12:02:22 -0400 Subject: [PATCH 2/2] Add target to cache key --- .github/workflows/ci.yml | 2 ++ .github/workflows/publish.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 215312d..d472ce9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,8 @@ jobs: components: clippy - name: Rust Cache uses: Swatinem/rust-cache@v2.2.1 + with: + key: ${{ matrix.target }} - name: Install Cross uses: actions-rs/install@v0.1 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7ff989b..d024624 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -74,6 +74,8 @@ jobs: profile: minimal - name: Rust Cache uses: Swatinem/rust-cache@v2.2.1 + with: + key: ${{ matrix.target }} - name: Archive Release uses: taiki-e/upload-rust-binary-action@v1 with: