Skip to content

Commit

Permalink
fix: lower cache usage by reusing more of the yarn caches
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed Oct 2, 2023
1 parent a496b0d commit 38d58b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ jobs:
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
# only restore as an individual cache per matrix explodes our cache usage
- uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-matrix-integration-${{ matrix.target }}
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-integration
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-integration
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
Expand Down Expand Up @@ -187,13 +186,12 @@ jobs:
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
# only restore as an individual cache per matrix explodes our cache usage
- uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
# put matrix before integration to not restore caches from other sibling matrix jobs
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-matrix-integration-${{ matrix.target }}
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-integration
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-integration
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ jobs:
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: ${{ steps.global-cache-dir-path.outputs.yarn }}
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-unit-${{ inputs.package }}
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-unit
restore-keys: |
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-unit-
yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
yarn-${{ runner.os }}-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
Expand Down

0 comments on commit 38d58b2

Please sign in to comment.