Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

4.0 KB
Raw Blame
name: "Setup and install"
description: "Common setup steps for Actions"

inputs:
  next-cache:
    description: Next.js compiler caches to restore (none, nextjs, docs, all)
    default: "none"
  turbo-cache:
    description: Restore local Turbo artifacts when signed remote caching is not configured
    default: "false"
  typecheck-cache:
    description: Reuse TypeScript incremental state when a Turbo task misses cache
    default: "false"
  typecheck-cache-scope:
    description: Isolate incremental snapshots for parallel typecheck shards
    default: "default"

runs:
  using: composite
  steps:
    - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
      with:
        node-version: 24.22.1

    - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
      with:
        bun-version: 1.4.4

    - name: Identify the build platform
      shell: bash
      run: |
        node --input-type=module -e '
          import { appendFileSync } from "node:fs";
          const arch = { x64: "amd64", arm64: "arm64" }[process.arch] ?? process.arch;
          let libc = "musl";
          if (process.report.getReport().header.glibcVersionRuntime) libc = "glibc";
          appendFileSync(process.env.GITHUB_ENV, `TURBO_PLATFORM=${process.platform}/${arch}/${libc}/node-${process.versions.node}\n`);
        '

    - name: Restore Bun dependency cache
      if: "!env.ACT"
      uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
      with:
        path: ~/.bun/install/cache
        key: ${{ runner.os }}-${{ runner.arch }}-bun-1.4.4-${{ hashFiles('bun.lock', 'bunfig.toml', 'package.json', 'patches/**') }}
        restore-keys: |
          ${{ runner.os }}-${{ runner.arch }}-bun-1.4.4-

    - shell: bash
      run: bun install --frozen-lockfile --concurrent-scripts=1

    - name: Restore local Turbo artifacts
      if: inputs.turbo-cache == 'true' && !env.ACT && !(env.TURBO_API != '' && env.TURBO_TEAM != '' && env.TURBO_TOKEN != '' && env.TURBO_REMOTE_CACHE_SIGNATURE_KEY != '')
      uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
      with:
        path: .turbo/cache
        key: ${{ env.TURBO_PLATFORM }}-turbo-${{ github.job }}-${{ inputs.typecheck-cache-scope }}-${{ hashFiles('bun.lock') }}-${{ github.sha }}
        restore-keys: |
          ${{ env.TURBO_PLATFORM }}-turbo-${{ github.job }}-${{ inputs.typecheck-cache-scope }}-${{ hashFiles('bun.lock') }}-

    - name: Restore TypeScript incremental state
      if: inputs.typecheck-cache == 'true' && !env.ACT
      uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
      with:
        path: |
          apps/*/node_modules/.cache/tsbuildinfo.json
          packages/*/node_modules/.cache/tsbuildinfo.json
        key: ${{ env.TURBO_PLATFORM }}-typecheck-${{ inputs.typecheck-cache-scope }}-${{ hashFiles('bun.lock', 'tooling/typescript/**', 'apps/*/tsconfig*.json', 'packages/*/tsconfig*.json') }}-${{ github.sha }}
        restore-keys: |
          ${{ env.TURBO_PLATFORM }}-typecheck-${{ inputs.typecheck-cache-scope }}-${{ hashFiles('bun.lock', 'tooling/typescript/**', 'apps/*/tsconfig*.json', 'packages/*/tsconfig*.json') }}-

    - name: Restore application compiler cache
      if: (inputs.next-cache == 'nextjs' || inputs.next-cache == 'all') && !env.ACT
      uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
      with:
        path: apps/nextjs/.next/cache
        key: ${{ env.TURBO_PLATFORM }}-nextjs-${{ hashFiles('bun.lock') }}-${{ github.sha }}
        restore-keys: |
          ${{ env.TURBO_PLATFORM }}-nextjs-${{ hashFiles('bun.lock') }}-

    - name: Restore documentation compiler cache
      if: (inputs.next-cache == 'docs' || inputs.next-cache == 'all') && !env.ACT
      uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
      with:
        path: apps/docs/.next/cache
        key: ${{ env.TURBO_PLATFORM }}-docs-${{ hashFiles('bun.lock') }}-${{ github.sha }}
        restore-keys: |
          ${{ env.TURBO_PLATFORM }}-docs-${{ hashFiles('bun.lock') }}-