name: "Setup Workspace Environment" description: "Sets up a Node.js environment and installs dependencies" inputs: node_version: description: "Node.js version to use" required: false # Keep this in sync with .nvmrc. default: "24" install: description: "Whether to install dependencies" required: false default: "true" build: description: "Whether to build the project" required: false default: "true" runs: using: "composite" steps: - name: Setup Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ inputs.node_version }} package-manager-cache: false - name: Setup pnpm uses: pnpm/setup@5d160c5bc68a09337ad0d5654e237e03253b5879 # v1 with: cache: false install: false - name: Install package.json dependencies with pnpm if: ${{ inputs.install == 'true' }} shell: bash env: # Puppeteer is only used by rrweb tests, which install Chrome explicitly # after confirming that rrweb is affected. PUPPETEER_SKIP_DOWNLOAD: "true" run: pnpm install --frozen-lockfile - name: Build project with pnpm if: ${{ inputs.build == 'true' }} shell: bash run: pnpm build