From f25cce0d781ab5bc650798bac27f77398ef25a45 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 1 Mar 2026 18:04:51 -0800 Subject: ci(dx): extract shared node+pnpm setup into composite action --- .github/actions/setup-node-pnpm/action.yml | 35 ++++++++++++++++++++++++++++++ .github/workflows/quality.yml | 15 ++----------- .github/workflows/release-trigger-prod.yml | 15 ++----------- 3 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 .github/actions/setup-node-pnpm/action.yml (limited to '.github') diff --git a/.github/actions/setup-node-pnpm/action.yml b/.github/actions/setup-node-pnpm/action.yml new file mode 100644 index 00000000..350c60a1 --- /dev/null +++ b/.github/actions/setup-node-pnpm/action.yml @@ -0,0 +1,35 @@ +name: Setup Node And pnpm +description: Setup pnpm, setup Node.js with pnpm cache, and install dependencies + +inputs: + node-version: + description: Node.js version + required: false + default: "20" + pnpm-version: + description: pnpm version + required: false + default: "10.28.0" + install: + description: Whether to install dependencies + required: false + default: "true" + +runs: + using: composite + steps: + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: ${{ inputs.pnpm-version }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + cache: pnpm + + - name: Install dependencies + if: ${{ inputs.install == 'true' }} + shell: bash + run: pnpm install --frozen-lockfile diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 532b1f72..a67a1b28 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -13,19 +13,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.28.0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup toolchain + uses: ./.github/actions/setup-node-pnpm - name: Generate GraphQL artifacts run: pnpm exec sveltekit-graphql generate diff --git a/.github/workflows/release-trigger-prod.yml b/.github/workflows/release-trigger-prod.yml index a0691e96..410829e1 100644 --- a/.github/workflows/release-trigger-prod.yml +++ b/.github/workflows/release-trigger-prod.yml @@ -18,19 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.28.0 - - - name: Use Node.js 20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup toolchain + uses: ./.github/actions/setup-node-pnpm - name: 🚀 Deploy Trigger.dev env: -- cgit v1.2.3