Add restore-keys to github actions (#297)

This commit is contained in:
Ryan Orendorff
2023-08-10 10:17:37 -06:00
committed by GitHub
parent 480453fe13
commit 9af787075a
4 changed files with 24 additions and 2 deletions

View File

@@ -26,6 +26,9 @@ jobs:
~/.cargo/git/db/
mdBook/target
key: ${{ runner.os }}-cargo-mdBook-${{ hashFiles('mdBook/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-mdBook-
${{ runner.os }}-cargo-
- name: Build mdBook
run: cargo build --release
working-directory: ./mdBook
@@ -44,4 +47,4 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
AWS_DEFAULT_REGION: us-west-2

View File

@@ -30,6 +30,10 @@ jobs:
rust-playground/target
rust-playground/ui/frontend/node_modules
key: ${{ runner.os }}-playground-${{ hashFiles('rust-playground/Cargo.lock') }}-${{ hashFiles('rust-playground/ui/frontend/yarn.lock') }}
restore-keys: |
${{ runner.os }}-playground-${{ hashFiles('rust-playground/Cargo.lock') }}-${{ hashFiles('rust-playground/ui/frontend/yarn.lock') }}
${{ runner.os }}-playground-${{ hashFiles('rust-playground/Cargo.lock') }}-
${{ runner.os }}-playground-
- name: Install frontend UI dependencies
run: yarn install
working-directory: ./rust-playground/ui/frontend

View File

@@ -26,6 +26,9 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
${{ runner.os }}-cargo
- uses: actions/cache@v3
with:
path: |
@@ -35,6 +38,9 @@ jobs:
~/.cargo/git/db/
mdBook/target
key: ${{ runner.os }}-cargo-mdBook-${{ hashFiles('mdBook/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-mdBook-
${{ runner.os }}-cargo-
# Checks are ordered from fastest to slowest so your build fails quickly on invalid PRs
# We do everything in release mode so tests run quickly and steps cache each other.
# Check the submitted change meets style guidelines
@@ -70,6 +76,9 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-clippy-
${{ runner.os }}-cargo-
# Check the submitted change passes the clippy linter
- name: Cargo clippy
run: cargo clippy --release --all-targets -- --deny warnings
@@ -89,6 +98,9 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-doc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-doc-
${{ runner.os }}-cargo-
# Cursory check to ensure your CL contains valid Rust code
- name: Cargo check
run: cargo check --release

View File

@@ -26,6 +26,9 @@ jobs:
~/.cargo/git/db/
mdBook/target
key: ${{ runner.os }}-cargo-mdBook-${{ hashFiles('mdBook/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-mdBook-
${{ runner.os }}-cargo-
- name: Copy site to S3
run: aws s3 cp src/* s3://sunscreen-site
working-directory: ./website
@@ -38,4 +41,4 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
AWS_DEFAULT_REGION: us-west-2