From 38d58b2f37c7d56fcef529c1c37d87b999916098 Mon Sep 17 00:00:00 2001 From: Ansgar Mertens Date: Mon, 2 Oct 2023 14:53:53 +0200 Subject: [PATCH] fix: lower cache usage by reusing more of the yarn caches --- .github/workflows/integration.yml | 14 ++++++-------- .github/workflows/unit.yml | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 304ea1dd94..9ec5094182 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -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 @@ -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 diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 5b5970c0e4..364f484fbd 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -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