From 60cc7c98fbf7df0f0fb7c5723bcef2f580bd535c Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Thu, 14 Jul 2022 00:44:01 -0700 Subject: [PATCH] fix(actions): use rust-cache action (#1974) I think the CI failures we've been seeing lately are due to bad incremental compilation artifacts being cached. The rust-cache action is smarter about what it actually caches. --- .github/workflows/sqlx.yml | 65 ++++++++++---------------------------- 1 file changed, 16 insertions(+), 49 deletions(-) diff --git a/.github/workflows/sqlx.yml b/.github/workflows/sqlx.yml index c9cf061a95..6f8f49ee2a 100644 --- a/.github/workflows/sqlx.yml +++ b/.github/workflows/sqlx.yml @@ -43,14 +43,10 @@ jobs: toolchain: stable override: true - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-check-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }} - + key: ${{ runner.os }}-check-${{ matrix.runtime }}-${{ matrix.tls }} + - uses: actions-rs/cargo@v1 with: command: check @@ -82,13 +78,9 @@ jobs: toolchain: stable override: true - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-test - uses: actions-rs/cargo@v1 with: @@ -127,13 +119,9 @@ jobs: target: ${{ matrix.target }} override: true - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cli-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cli - uses: actions-rs/cargo@v1 with: @@ -162,13 +150,9 @@ jobs: toolchain: stable override: true - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-sqlite-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-sqlite-${{ matrix.runtime }}-${{ matrix.tls }} - uses: actions-rs/cargo@v1 with: @@ -199,13 +183,9 @@ jobs: toolchain: stable override: true - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ matrix.tls }} - uses: actions-rs/cargo@v1 env: @@ -263,13 +243,9 @@ jobs: toolchain: stable override: true - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ matrix.tls }} - uses: actions-rs/cargo@v1 with: @@ -307,14 +283,9 @@ jobs: toolchain: stable override: true - # same Cargo features as MySQL so the same cache can be used - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ matrix.tls }} - uses: actions-rs/cargo@v1 with: @@ -352,12 +323,8 @@ jobs: toolchain: stable override: true - - uses: actions/cache@v2 + - uses: Swatinem/rust-cache@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target key: ${{ runner.os }}-mssql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }} - uses: actions-rs/cargo@v1