From 4030dee789de91befaf6545cb7e205e3e539ec72 Mon Sep 17 00:00:00 2001 From: Michael Seele Date: Tue, 5 May 2026 13:06:35 +0000 Subject: [PATCH] feat: add caching for pnpm store and Terraform providers --- pnpm-build/action.yml | 12 ++++++++++++ terraform-apply/action.yml | 13 +++++++++++++ terraform-validate/action.yml | 13 +++++++++++++ 3 files changed, 38 insertions(+) diff --git a/pnpm-build/action.yml b/pnpm-build/action.yml index 30ff3f2..c0c02f1 100644 --- a/pnpm-build/action.yml +++ b/pnpm-build/action.yml @@ -49,6 +49,18 @@ runs: with: version: ${{ inputs.pnpm-version }} + - name: Get pnpm store directory + id: pnpm-store + shell: bash + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/cache@cache-v1 + with: + path: ${{ steps.pnpm-store.outputs.path }} + key: ${{ runner.os }}-pnpm-${{ inputs.pnpm-version }}-${{ hashFiles(format('{0}/pnpm-lock.yaml', inputs.working-directory)) }} + restore-keys: ${{ runner.os }}-pnpm-${{ inputs.pnpm-version }}- + - name: Configure pnpm registry authentication if: ${{ inputs.jfrog-token != '' }} shell: bash diff --git a/terraform-apply/action.yml b/terraform-apply/action.yml index 23899ac..fe50795 100644 --- a/terraform-apply/action.yml +++ b/terraform-apply/action.yml @@ -34,6 +34,19 @@ runs: with: terraform_version: ${{ inputs.terraform-version }} + - name: Set Terraform plugin cache directory + shell: bash + run: | + mkdir -p ~/.terraform.d/plugin-cache + echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >> "$GITHUB_ENV" + + - name: Cache Terraform providers + uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/cache@cache-v1 + with: + path: ~/.terraform.d/plugin-cache + key: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}-${{ hashFiles(format('{0}/.terraform.lock.hcl', inputs.terraform-dir)) }} + restore-keys: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}- + - name: Terraform Init shell: bash env: diff --git a/terraform-validate/action.yml b/terraform-validate/action.yml index 56cff6f..9ca015a 100644 --- a/terraform-validate/action.yml +++ b/terraform-validate/action.yml @@ -30,6 +30,19 @@ runs: with: terraform_version: ${{ inputs.terraform-version }} + - name: Set Terraform plugin cache directory + shell: bash + run: | + mkdir -p ~/.terraform.d/plugin-cache + echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >> "$GITHUB_ENV" + + - name: Cache Terraform providers + uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/cache@cache-v1 + with: + path: ~/.terraform.d/plugin-cache + key: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}-${{ hashFiles(format('{0}/.terraform.lock.hcl', inputs.terraform-dir)) }} + restore-keys: ${{ runner.os }}-terraform-providers-${{ inputs.terraform-version }}- + - name: Terraform Init shell: bash env: