Skip to content

Latest commit

 

History

History
94 lines (66 loc) · 3.57 KB

README.md

File metadata and controls

94 lines (66 loc) · 3.57 KB
Build Status Commits since latest release Codecov Follow on Twitter (X)

PNPM / Install

This GitHub Action installs mono-repository dependencies using PNPM. It's designed to efficiently handle dependencies in a mono-repository setup, enabling corepack support and caching node modules to speed up builds.

This action is ideal for projects that require optimal dependency management and fast execution of workflows within CI environments.


Example Usage

Create a new workflow file, for example, .github/workflows/build.yml, and add the following code to it.

---

on:
  push:
    branches:
      - master
  pull_request:

name: 🔍 Continuous integration for web app

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: 📦 Check out the codebase
        uses: actions/checkout@v4

     # ...

      - name: ⚙️ Setup PNPM mono-repository
        uses: wayofdev/gh-actions/actions/pnpm/install@master
        with:
          cwd: '.'
          enable-corepack: true
          cache-prefix: 'ci-build'
          cache-node-modules: true

    # ...

...

For details, see actions/pnpm/install/action.yml.

Real-world examples can be found in the wayofdev/next-starter-tpl repository.


Structure

Inputs

  • cwd, optional: Changes Node's process current working directory. Defaults to the root directory (.).
  • enable-corepack, optional: Enables corepack to manage package installations. Defaults to false.
  • cache-prefix, optional: Specifies a custom prefix for caching mechanisms. Defaults to default.
  • cache-node-modules, optional: Enables caching of node_modules directories. Defaults to false.

Outputs

none

Side Effects

  • Enabling corepack sets up the package manager environment using the system's corepack feature.
  • PNPM is installed or configured according to the presence of corepack.
  • Caching keys are created and used for faster retrieval of the node_modules and pnpm store directories.
  • Dependencies are installed with options such as --no-frozen-lockfile, --strict-peer-dependencies, and --prefer-offline to ensure consistency and reproducibility across installations.