/setup-js

Shareable GitHub Workflow Action to Setup Workspace for JavaScript/TypeScript Projects.

GNU General Public License v2.0GPL-2.0

action/setup-js

License Open Issues Closed Issues Open Pulls Closed Pulls Contributors Activity

Description

Github Action to Setup Workspace with appropriate Runtime and Package Manager, along with Project dependencies for JavaScript and TypeScript projects.

Usage

  • Setup Basic NPM workspace:
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
  • Setup Specific Node Version (v22.x):
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          version: 22.x
  • Setup Specific Node Version (read from .nvmrc):
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          version-file: .nvmrc
  • Setup Yarn Workspace:
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          cache: yarn
  • Setup Pnpm Workspace:
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          cache: pnpm
  • Setup Bun Workspace (only Package Manager):
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          cache: bun
  • Setup Specific Bun Version (v1.x, only Package Manager):
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          cache: bun
          cache-version: 1.x
  • Setup Specific Bun Version (read from .bun-version, only Package Manager):
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          cache: bun
          cache-version-file: .bun-version
  • Setup Bun Workspace:
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          runtime: bun
  • Setup Specific Bun Version (v1.x):
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          runtime: bun
          version: 1.x
  • Setup Specific Bun Version (read from .bun-version):
---
name: Test

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Workspace
        uses: 0xTheProDev/setup-js@v1.3
        with:
          runtime: bun
          version-file: .bun-version

Reporting a Bug

Head on to Discussion section to report a bug or to ask for any feature. Feel to add your queries about using this library as well under Q & A section of it. Remember, do not create any Issues by yourself, maintainers of this repository will open one if deemed necessary.

Changelog

See CHANGELOG for more details on what has been changed in the latest release.

Contributing

See Contributing Guidelines.

License

This project is licensed under the terms of the MIT license, see LICENSE for more details.

The Pro Dev