From 8bebcec91ce05605779fd33d5e7ac6e207b065eb Mon Sep 17 00:00:00 2001 From: Jonathan Daniel Date: Tue, 23 Jul 2024 21:07:10 +0300 Subject: [PATCH] Use a true/false key in the build cache Reduce the number of caches to only two. --- .github/workflows/build.yml | 2 ++ .github/workflows/setup-rust-cache/action.yml | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fecae2c8..8ddae674 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -132,6 +132,8 @@ jobs: - name: Setup Rust cache uses: ./.github/workflows/setup-rust-cache + with: + key: ${{ contains(fromJSON(env.LINK_CHECKED_LANGUAGES), matrix.language) }} - name: Install Gettext run: | diff --git a/.github/workflows/setup-rust-cache/action.yml b/.github/workflows/setup-rust-cache/action.yml index 1bfde298..ff123aaa 100644 --- a/.github/workflows/setup-rust-cache/action.yml +++ b/.github/workflows/setup-rust-cache/action.yml @@ -2,6 +2,12 @@ name: Setup Rust cache description: Configure the rust-cache workflow. +inputs: + key: + description: Additional caching key + required: false + default: + runs: using: composite steps: @@ -11,5 +17,5 @@ runs: # Only save the cache on the main branch to avoid PRs filling # up the cache. save-if: ${{ github.ref == 'refs/heads/main' }} - # Further, save the cache per language. - key: ${{ matrix.language }} + # Further, save the cache per key - e.g. language grouping. + key: ${{ inputs.key }}