Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

1.1 KB
Raw Blame
name: 'Install'
description: 'Sets up Node.js and runs install'

runs:
  using: composite
  steps:
    - uses: actions/setup-node@v4
      with:
        node-version: 18

    - name: Install turbo
      shell: bash
      run: npm i -g turbo

    - uses: pnpm/action-setup@v4
      with:
        version: 10.11.0

    - uses: actions/cache@v4
      name: pnpm-cache
      id: pnpm-cache
      with:
        path: |
          **/node_modules
          ${{ steps.pnpm-cache-dir-path.outputs.dir }}
        key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
        restore-keys: |
          ${{ runner.os }}-pnpm

    - name: Cache TypeScript TSBuild Info Files
      uses: actions/cache@v4
      with:
        path: '*/*/node_modules/.cache/tsbuildinfo.json'
        # Commit hash is for working around this: https://github.com/actions/cache/issues/106
        key: ${{ runner.os }}-cache-typescript-tsbuildinfo-${{ github.sha }}
        restore-keys: ${{ runner.os }}-cache-typescript-tsbuildinfo-

    - name: pnpm
      shell: bash
      if: steps.pnpm-cache.outputs.cache-hit != 'true'
      run: pnpm install --frozen-lockfile --prefer-offline