Continuous Integration
pnpm can easily be used in various continuous integration systems.
#
TravisOn Travis CI, you can use pnpm for installing your dependencies by adding this
to your .travis.yml
file:
cache: npm: false directories: - "~/.pnpm-store"before_install: - curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 - pnpm config set store-dir ~/.pnpm-storeinstall: - pnpm install
#
SemaphoreOn Semaphore, you can use pnpm for installing and caching your dependencies by
adding this to your .semaphore/semaphore.yml
file:
version: v1.0name: Semaphore CI pnpm exampleagent: machine: type: e1-standard-2 os_image: ubuntu1804blocks: - name: Install dependencies task: jobs: - name: pnpm install commands: - curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 - checkout - cache restore node-$(checksum pnpm-lock.yaml) - pnpm install - cache store node-$(checksum pnpm-lock.yaml) ~/.pnpm-store
#
AppVeyorOn AppVeyor, you can use pnpm for installing your dependencies by adding this
to your appveyor.yml
:
install: - ps: Install-Product node $env:nodejs_version - curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 - pnpm install
#
Sail CIOn [Sail CI], you can use pnpm for installing your dependencies by adding this to your .sail.yml
file:
install: image: znck/pnpm:latest command: - pnpm args: - install
To get the exact Node version and pnpm version you require you can always make your own Docker image and push to Docker Hub.
#
GitHub ActionsOn GitHub Actions, you can use pnpm for installing and caching your dependencies
like so (belongs in .github/workflows/NAME.yml
):
name: pnpm Example Workflowon: push:jobs: build: runs-on: ubuntu-20.04 strategy: matrix: node-version: [15] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - name: Cache .pnpm-store uses: actions/cache@v1 with: path: ~/.pnpm-store key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Install pnpm run: curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 - name: pnpm Build run: pnpm install
note
Using actions/setup-node@v2
you need to install pnpm with root permissions, eg:sudo npm install -g pnpm
. Alternatively, if you specify the Node.js version to use, pnpm may be installed with no priviledged user.
#
Gitlab CIOn Gitlab, you can use pnpm for installing and caching your dependencies
like so (belongs in .gitlab-ci.yml
):
stages: - build
build: stage: build image: node:14.16.0-buster before_script: - curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 - pnpm config set store-dir .pnpm-store script: - pnpm install # install dependencies cache: key: "$CI_COMMIT_REF_SLUG" paths: - .pnpm-store
#
Bitbucket PipelinesYou can use pnpm for installing and caching your dependencies:
definitions: caches: pnpm: $BITBUCKET_CLONE_DIR/.pnpm-store
pipelines: pull-requests: "**": - step: name: Build and test image: node:14.16.0 script: - curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm@6 - pnpm install - pnpm run build # Replace with your build/test…etc. commands caches: - pnpm