Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
265 changes: 132 additions & 133 deletions docs/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,6 @@ In all the provided configuration files the store is cached. However, this is no

:::

## Travis

On [Travis CI], you can use pnpm for installing your dependencies by adding this
to your `.travis.yml` file:

```yaml title=".travis.yml"
cache:
npm: false
directories:
- "~/.pnpm-store"
before_install:
- npm install --global corepack@latest
- corepack enable
- corepack prepare pnpm@latest-10 --activate
- pnpm config set store-dir ~/.pnpm-store
install:
- pnpm install
```

[Travis CI]: https://travis-ci.org

## Semaphore

On [Semaphore], you can use pnpm for installing and caching your dependencies by
adding this to your `.semaphore/semaphore.yml` file:

```yaml title=".semaphore/semaphore.yml"
version: v1.0
name: Semaphore CI pnpm example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Install dependencies
task:
jobs:
- name: pnpm install
commands:
- npm install --global corepack@latest
- corepack enable
- corepack prepare pnpm@latest-10 --activate
- checkout
- cache restore node-$(checksum pnpm-lock.yaml)
- pnpm install
- cache store node-$(checksum pnpm-lock.yaml) $(pnpm store path)
```

[Semaphore]: https://semaphoreci.com

## AppVeyor

On [AppVeyor], you can use pnpm for installing your dependencies by adding this
Expand All @@ -77,62 +27,32 @@ install:

[AppVeyor]: https://www.appveyor.com

## GitHub Actions

On GitHub Actions, you can use pnpm for installing and caching your dependencies
like so (belongs in `.github/workflows/NAME.yml`):

```yaml title=".github/workflows/NAME.yml"
name: pnpm Example Workflow
on:
push:
## Azure Pipelines

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
```
On Azure Pipelines, you can use pnpm for installing and caching your dependencies by adding this to your `azure-pipelines.yml`:

## GitLab CI
```yaml title="azure-pipelines.yml"
variables:
pnpm_config_cache: $(Pipeline.Workspace)/.pnpm-store

On GitLab, you can use pnpm for installing and caching your dependencies
like so (belongs in `.gitlab-ci.yml`):
steps:
- task: Cache@2
inputs:
key: 'pnpm | "$(Agent.OS)" | pnpm-lock.yaml'
path: $(pnpm_config_cache)
displayName: Cache pnpm

```yaml title=".gitlab-ci.yml"
stages:
- build
- script: |
npm install --global corepack@latest
corepack enable
corepack prepare pnpm@latest-10 --activate
pnpm config set store-dir $(pnpm_config_cache)
displayName: "Setup pnpm"

build:
stage: build
image: node:18.17.1
before_script:
- npm install --global corepack@latest
- corepack enable
- corepack prepare pnpm@latest-10 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm install # install dependencies
cache:
key:
files:
- pnpm-lock.yaml
paths:
- .pnpm-store
- script: |
pnpm install
pnpm run build
displayName: "pnpm install and build"
```

## Bitbucket Pipelines
Expand Down Expand Up @@ -160,35 +80,6 @@ pipelines:
- pnpm
```

## Azure Pipelines

On Azure Pipelines, you can use pnpm for installing and caching your dependencies by adding this to your `azure-pipelines.yml`:

```yaml title="azure-pipelines.yml"
variables:
pnpm_config_cache: $(Pipeline.Workspace)/.pnpm-store

steps:
- task: Cache@2
inputs:
key: 'pnpm | "$(Agent.OS)" | pnpm-lock.yaml'
path: $(pnpm_config_cache)
displayName: Cache pnpm

- script: |
npm install --global corepack@latest
corepack enable
corepack prepare pnpm@latest-10 --activate
pnpm config set store-dir $(pnpm_config_cache)
displayName: "Setup pnpm"

- script: |
pnpm install
pnpm run build
displayName: "pnpm install and build"
```


## CircleCI

On CircleCI, you can use pnpm for installing and caching your dependencies by adding this to your `.circleci/config.yml`:
Expand Down Expand Up @@ -227,6 +118,64 @@ jobs:
- .pnpm-store
```

## GitHub Actions

On GitHub Actions, you can use pnpm for installing and caching your dependencies
like so (belongs in `.github/workflows/NAME.yml`):

```yaml title=".github/workflows/NAME.yml"
name: pnpm Example Workflow
on:
push:

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
```

## GitLab CI

On GitLab, you can use pnpm for installing and caching your dependencies
like so (belongs in `.gitlab-ci.yml`):

```yaml title=".gitlab-ci.yml"
stages:
- build

build:
stage: build
image: node:18.17.1
before_script:
- npm install --global corepack@latest
- corepack enable
- corepack prepare pnpm@latest-10 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm install # install dependencies
cache:
key:
files:
- pnpm-lock.yaml
paths:
- .pnpm-store
```

## Jenkins

You can use pnpm for installing and caching your dependencies:
Expand All @@ -235,12 +184,12 @@ You can use pnpm for installing and caching your dependencies:
pipeline {
agent {
docker {
image 'node:lts-bullseye-slim'
args '-p 3000:3000'
image 'node:lts-bullseye-slim'
args '-p 3000:3000'
}
}
stages {
stage('Build') {
stage('Build') {
steps {
sh 'npm install --global corepack@latest'
sh 'corepack enable'
Expand All @@ -251,3 +200,53 @@ pipeline {
}
}
```

## Semaphore

On [Semaphore], you can use pnpm for installing and caching your dependencies by
adding this to your `.semaphore/semaphore.yml` file:

```yaml title=".semaphore/semaphore.yml"
version: v1.0
name: Semaphore CI pnpm example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Install dependencies
task:
jobs:
- name: pnpm install
commands:
- npm install --global corepack@latest
- corepack enable
- corepack prepare pnpm@latest-10 --activate
- checkout
- cache restore node-$(checksum pnpm-lock.yaml)
- pnpm install
- cache store node-$(checksum pnpm-lock.yaml) $(pnpm store path)
```

[Semaphore]: https://semaphoreci.com

## Travis

On [Travis CI], you can use pnpm for installing your dependencies by adding this
to your `.travis.yml` file:

```yaml title=".travis.yml"
cache:
npm: false
directories:
- "~/.pnpm-store"
before_install:
- npm install --global corepack@latest
- corepack enable
- corepack prepare pnpm@latest-10 --activate
- pnpm config set store-dir ~/.pnpm-store
install:
- pnpm install
```

[Travis CI]: https://travis-ci.org