mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-21 12:10:29 +00:00
83af7aa92e
- only `cache-seeder` writes caches, every other workflow restores. Saves were being rejected once the repo went over its cache budget, leaving main's caches stale and PR runs building cold - seed the pnpm store and uv caches next to the go ones, so PRs warm-start on them rather than installing from scratch - prune keeps a single generation per key, including across go versions, where a toolchain bump leaves the previous build cache unusable. Reclaims ~2.6 GB immediately - prune runs every 6h instead of daily and trims to 6 GB, since CodeQL writes ~200 MB per push to main from outside this repo's workflows - pull requests and release branches no longer write pnpm, uv and binfmt caches, whose ref-scoped copies are never read again --------- Signed-off-by: silverwind <me@silverwind.io>
31 lines
1.2 KiB
YAML
31 lines
1.2 KiB
YAML
name: node-setup
|
|
description: Set up pnpm and node and restore the pnpm store cache
|
|
|
|
inputs:
|
|
cache:
|
|
description: Restore the pnpm store cache
|
|
default: "true"
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
|
with:
|
|
node-version: 26
|
|
- if: ${{ inputs.cache == 'true' }}
|
|
id: store
|
|
shell: bash
|
|
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
|
|
- if: ${{ inputs.cache == 'true' && github.workflow == 'cache-seeder' }}
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ steps.store.outputs.path }}
|
|
key: pnpm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
|
|
- if: ${{ inputs.cache == 'true' && github.workflow != 'cache-seeder' }}
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ steps.store.outputs.path }}
|
|
key: pnpm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
|
|
restore-keys: pnpm-${{ runner.os }}-${{ runner.arch }}-
|