Skip to content

Commit

Permalink
fix(actions): use rust-cache action
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abonander committed Jul 14, 2022
1 parent d6c4eff commit 9f546ef
Showing 1 changed file with 16 additions and 49 deletions.
65 changes: 16 additions & 49 deletions .github/workflows/sqlx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9f546ef

Please sign in to comment.