name: Setup Node.js, pnpm and dependencies
description: Setup Node.js, pnpm and dependencies
inputs:
  token:
    description: Github token
    required: false
    default: ''
runs:
  using: 'composite'
  steps:
    - name: Install pnpm
      uses: pnpm/action-setup@v3
      with:
        version: 9.0.6

    - name: Install Node.js
      uses: actions/setup-node@v4
      with:
        token: ${{ inputs.token }}
        check-latest: true
        node-version-file: '.nvmrc'

    - name: Install pnpm deps
      shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}
      env:
        NODE_ENV: debug
        GITHUB_TOKEN: ${{ inputs.token }}
      run: pnpm i --frozen-lockfile
