Skip to content
Closed
Show file tree
Hide file tree
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
72 changes: 0 additions & 72 deletions .github/actions/setup-node-pnpm/README.md

This file was deleted.

56 changes: 24 additions & 32 deletions .github/actions/setup-node-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,42 @@
name: 'Setup Node.js and pnpm'
description: 'Reusable action to setup Node.js and pnpm with caching'

inputs:
node-version:
description: 'Node.js version to install'
required: false
default: 'lts/*'
enable-cache:
description: 'Enable pnpm store caching'
required: false
default: 'true'
frozen-lockfile:
description: 'Use frozen lockfile for pnpm install'
required: false
default: 'true'
name: Setup Node and pnpm

runs:
using: 'composite'
using: composite
steps:
- name: Setup Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
# see pnpm cache setting below
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Get pnpm store directory
if: inputs.enable-cache == 'true'
id: store
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
if: inputs.enable-cache == 'true'
- name: Save and restore pnpm cache on main
uses: actions/cache@v4
if: ${{ github.ref_name == 'main' }}
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ steps.store.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
- name: Restore pnpm cache on PR
uses: actions/cache/restore@v4
if: ${{ github.ref_name != 'main' }}
with:
path: ${{ steps.store.outputs.STORE_PATH }}
key: |
${{ runner.os }}-pnpm-store-

- run: pnpm install --frozen-lockfile --ignore-scripts
shell: bash
run: pnpm install${{ inputs.frozen-lockfile == 'true' && ' --frozen-lockfile' || '' }}
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>Boshen/renovate"]
}
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:

- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm
with:
enable-cache: true
frozen-lockfile: true

- name: Lint code
run: pnpm lint
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jobs:

- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm
with:
enable-cache: false
frozen-lockfile: false

- name: Run lint
run: pnpm lint
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:

- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm
with:
enable-cache: false
frozen-lockfile: false

- name: Lint
run: pnpm lint
Expand Down
38 changes: 5 additions & 33 deletions .github/workflows/update-rolldown-stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,13 @@ permissions:
jobs:
update-stats:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Run rolldown stats collection
run: pnpm rolldown:stats
Expand All @@ -65,12 +37,12 @@ jobs:
- name: Commit and push changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "boshen@gmail.com"
git config --local user.email "1430279+Boshen@users.noreply.github.com"
git config --local user.name "Boshen"
git add rolldown-version-stats.json
git commit -m "chore: update rolldown version stats"
git push origin main

- name: No changes to commit
if: steps.git-check.outputs.changes != 'true'
run: echo "No changes were detected in rolldown-version-stats.json, skipping commit."
run: echo "No changes were detected in rolldown-version-stats.json, skipping commit."
File renamed without changes.
Loading