Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,42 @@ outputs:
runs:
using: "composite"
steps:
- name: Enable Corepack
shell: bash
run: corepack enable
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: ${{ github.action_path }}/pnpm-lock.yaml

- name: Get cache keys
id: cache-keys
shell: bash
run: |
echo "PNPM_STORE=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
# Hash the lockfile for cache key
LOCK_HASH=$(sha256sum "${{ github.action_path }}/pnpm-lock.yaml" | cut -d' ' -f1 | head -c 16)
echo "LOCK_HASH=$LOCK_HASH" >> $GITHUB_OUTPUT

- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.cache-keys.outputs.PNPM_STORE }}
key: tempo-lints-pnpm-store-${{ runner.os }}-${{ steps.cache-keys.outputs.LOCK_HASH }}
restore-keys: |
tempo-lints-pnpm-store-${{ runner.os }}-

- name: Cache node_modules (includes sg binary)
id: cache-node-modules
uses: actions/cache@v4
with:
path: ${{ github.action_path }}/node_modules
key: tempo-lints-node-modules-${{ runner.os }}-${{ steps.cache-keys.outputs.LOCK_HASH }}

- name: Install tempo-lints dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
shell: bash
run: cd "${{ github.action_path }}" && pnpm install --frozen-lockfile

Expand Down