sailfork / t3code-github / .repos/ effect/ .github/ actions/ setup/ action.yaml

name: Setup
description: Perform standard setup and install dependencies using pnpm.
inputs:
  node-version:
    description: The version of Node to install
    required: false
  deno-version:
    description: The version of Deno to install
    required: false
  bun-version:
    description: The version of Bun to install
    required: false

runs:
  using: composite
  steps:
    - name: Install pnpm
      uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
      env:
        npm_config_audit: "false"
        npm_config_fund: "false"
        # `pnpm self-update` downloads the 47 MB @pnpm/linux-x64 tarball; keep in sync with pnpm-workspace.yaml
        pnpm_config_fetch_timeout: "180000"
    - name: Install node
      uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
      with:
        node-version: ${{ inputs.node-version || '26.12.1' }}
        package-manager-cache: ${{ env.NSC_CONTAINER_REGISTRY == '' }}
        cache: ${{ env.NSC_CONTAINER_REGISTRY == '' && 'pnpm' || '' }}
        cache-dependency-path: pnpm-lock.yaml
    - name: Configure pnpm cache
      if: ${{ env.NSC_CONTAINER_REGISTRY != '' }}
      uses: namespacelabs/nscloud-cache-action@c5f8dab7560444c4bf8dbc64f1b203431873c547 # v1.6.1
      with:
        cache: pnpm
    - name: Install deno
      uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
      if: ${{ inputs.deno-version != '' }}
      with:
        deno-version: ${{ inputs.deno-version }}
    - name: Install bun
      uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
      if: ${{ inputs.bun-version != '' }}
      with:
        bun-version: ${{ inputs.bun-version }}
    - name: Install dependencies
      shell: bash
      run: pnpm install