mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
name: 'Setup Workflow Dev Environment'
|
|
description: 'Setup Node.js, pnpm, and optionally Rust for Workflow development. Note: Checkout must be done before calling this action.'
|
|
|
|
inputs:
|
|
node-version:
|
|
description: 'Node.js version to use'
|
|
required: false
|
|
default: '22.x'
|
|
setup-rust:
|
|
description: 'Whether to setup Rust toolchain'
|
|
required: false
|
|
default: 'false'
|
|
install-dependencies:
|
|
description: 'Whether to install dependencies'
|
|
required: false
|
|
default: 'true'
|
|
install-args:
|
|
description: 'Additional arguments for pnpm install (e.g., --ignore-scripts)'
|
|
required: false
|
|
default: ''
|
|
build-packages:
|
|
description: 'Whether to build packages (excludes workbenches)'
|
|
required: false
|
|
default: 'true'
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Setup Rust
|
|
if: ${{ inputs.setup-rust == 'true' }}
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v5
|
|
|
|
- name: Setup Node.js ${{ inputs.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
# Only enable the pnpm store cache when this action actually runs
|
|
# `pnpm install`. Otherwise the store directory never exists and
|
|
# setup-node's post step fails the whole job with "Path Validation
|
|
# Error" whenever the cache restore missed (frequent on branches
|
|
# whose lockfile hash differs from main's caches).
|
|
cache: ${{ inputs.install-dependencies == 'true' && 'pnpm' || '' }}
|
|
|
|
- name: Install Dependencies
|
|
if: ${{ inputs.install-dependencies == 'true' }}
|
|
shell: bash
|
|
run: pnpm install --frozen-lockfile ${{ inputs.install-args }}
|
|
|
|
- name: Build all packages
|
|
if: ${{ inputs.build-packages == 'true' }}
|
|
shell: bash
|
|
run: pnpm turbo run build --filter='!./workbench/*'
|