Skip to content

Commit

Permalink
Use pnpm in CI workflows
Browse files Browse the repository at this point in the history
Use pnpm instead of yarn in CI workflow.

Define `packageManager` in `package.json` so the `pnpm/action-setup@v2`
job uses it to setup the correct pnpm version.
  • Loading branch information
nkuba committed Nov 23, 2023
1 parent fabc0c2 commit 109ff9c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 40 deletions.
40 changes: 24 additions & 16 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,40 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Format
run: yarn format
run: pnpm format

core-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Build
run: yarn build
run: pnpm build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
Expand All @@ -64,15 +68,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download Build Artifacts
uses: actions/download-artifact@v3
Expand All @@ -81,23 +87,25 @@ jobs:
path: core/

- name: Test
run: yarn test --no-compile
run: pnpm test --no-compile

core-deploy-dry-run:
needs: [core-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download Build Artifacts
uses: actions/download-artifact@v3
Expand All @@ -106,4 +114,4 @@ jobs:
path: core/

- name: Deploy
run: yarn deploy --no-compile
run: pnpm deploy --no-compile
22 changes: 10 additions & 12 deletions .github/workflows/dapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,31 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "dapp/.nvmrc"
cache: "yarn"
cache-dependency-path: "dapp/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Format
run: yarn format
run: pnpm format

dapp-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "dapp/.nvmrc"
cache: "yarn"
cache-dependency-path: "dapp/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Build
run: yarn build
run: pnpm build
22 changes: 10 additions & 12 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,31 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "website/.nvmrc"
cache: "yarn"
cache-dependency-path: "website/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Format
run: yarn format
run: pnpm format

website-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "website/.nvmrc"
cache: "yarn"
cache-dependency-path: "website/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Build
run: yarn build
run: pnpm build
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"private": true,
"packageManager": "[email protected]"
}

0 comments on commit 109ff9c

Please sign in to comment.