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/v5.js | node - add --global pnpm@5 - 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/v5.js | node - add --global pnpm@5 - 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/v5.js | node - add --global pnpm@5 - 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/v5.js | node - add --global pnpm@5 - 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.