Files
tabler/.github/actions/setup/action.yml

47 lines
1.6 KiB
YAML

name: Set up the workspace
description: Restore the turbo cache, install pnpm and Node.js, install the dependencies
inputs:
turbo-cache:
description: Restore and save the turbo cache. The release job turns it off so a cache written by another run cannot end up in a published package.
default: 'true'
runs:
using: composite
steps:
# The key carries the workflow name: cache keys are write-once, so with one
# key per commit the quickest workflow (lint) saved its near-empty cache and
# the build never got to store its outputs.
#
# A push starts from an empty cache and saves only what this build produced,
# which keeps the entry at the size of one build. Pull requests restore the
# latest entry of the base branch and save nothing.
- name: Save the turbo cache
if: inputs.turbo-cache == 'true' && github.event_name == 'push'
uses: actions/cache@v6
with:
path: .turbo/cache
key: ${{ runner.os }}-turbo-${{ github.workflow }}-${{ github.sha }}
- name: Restore the turbo cache
if: inputs.turbo-cache == 'true' && github.event_name != 'push'
uses: actions/cache/restore@v6
with:
path: .turbo/cache
key: ${{ runner.os }}-turbo-${{ github.workflow }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.workflow }}-
- name: Install PNPM
uses: pnpm/action-setup@v6.1.0
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install pnpm dependencies
run: pnpm install --frozen-lockfile
shell: bash