Skip to content

Commit c57b171

Browse files
authored
Merge pull request #24 from Turbo87/pnpm
Replace npm with pnpm
2 parents cdbc509 + ed74b61 commit c57b171

File tree

10 files changed

+3127
-4828
lines changed

10 files changed

+3127
-4828
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99

1010
permissions: {}
1111

12+
env:
13+
# renovate: datasource=npm depName=pnpm
14+
PNPM_VERSION: 10.12.4
15+
1216
jobs:
1317
test:
1418
name: Test
@@ -19,12 +23,17 @@ jobs:
1923
with:
2024
persist-credentials: false
2125

26+
- name: Install pnpm
27+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
28+
with:
29+
version: ${{ env.PNPM_VERSION }}
30+
2231
- name: Install node dependencies
23-
run: npm ci
32+
run: pnpm install --frozen-lockfile
2433

2534
- name: Test
2635
run: |
27-
npm run test
36+
pnpm test
2837
2938
lint:
3039
name: Lint
@@ -35,12 +44,17 @@ jobs:
3544
with:
3645
persist-credentials: false
3746

47+
- name: Install pnpm
48+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
49+
with:
50+
version: ${{ env.PNPM_VERSION }}
51+
3852
- name: Install node dependencies
39-
run: npm ci
53+
run: pnpm install --frozen-lockfile
4054

4155
- name: Lint
4256
run: |
43-
npm run lint
57+
pnpm lint
4458
4559
format:
4660
name: Format
@@ -51,11 +65,16 @@ jobs:
5165
with:
5266
persist-credentials: false
5367

68+
- name: Install pnpm
69+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
70+
with:
71+
version: ${{ env.PNPM_VERSION }}
72+
5473
- name: Install Prettier
55-
run: npm ci
74+
run: pnpm install --frozen-lockfile
5675

5776
- name: Format
58-
run: npx prettier --check .
77+
run: pnpm prettier --check .
5978

6079
zizmor:
6180
name: Zizmor
@@ -74,22 +93,6 @@ jobs:
7493
# Instead, fail if there's a security issue.
7594
advanced-security: false
7695

77-
npm-install:
78-
name: Lockfile up-to-date
79-
runs-on: ubuntu-24.04
80-
steps:
81-
- name: Checkout repository
82-
uses: actions/checkout@v4
83-
with:
84-
persist-credentials: false
85-
86-
- name: Check if package-lock.json is up-to-date
87-
run: |
88-
npm install
89-
90-
# Assert that the git diff is empty.
91-
git diff --exit-code || (echo "Git diff is not empty. Please run 'npm install' and commit the changes." && exit 1)
92-
9396
package:
9497
name: Package
9598
runs-on: ubuntu-24.04
@@ -99,16 +102,21 @@ jobs:
99102
with:
100103
persist-credentials: false
101104

105+
- name: Install pnpm
106+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
107+
with:
108+
version: ${{ env.PNPM_VERSION }}
109+
102110
- name: Install node dependencies
103-
run: npm ci
111+
run: pnpm install --frozen-lockfile
104112

105113
- name: Check is packaged
106114
run: |
107115
# Compile to single js files.
108-
npm run package
116+
pnpm package
109117
110118
# Assert that the git diff is empty.
111-
git diff --exit-code || (echo "Git diff is not empty. Please run 'npm run package' and commit the changes." && exit 1)
119+
git diff --exit-code || (echo "Git diff is not empty. Please run 'pnpm package' and commit the changes." && exit 1)
112120
113121
# This job tests the action directly by running it against a mock server.
114122
action-test:
@@ -200,7 +208,6 @@ jobs:
200208
- format
201209
- zizmor
202210
- package
203-
- npm-install
204211
- rustfmt
205212
- action-test
206213
- clippy

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Ignore artifacts:
22
dist
3+
pnpm-lock.yaml

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can't run this action locally as it requires a GitHub environment.
1818
To install node dependencies, run:
1919

2020
```sh
21-
npm install
21+
pnpm install
2222
```
2323

2424
### Packaging
@@ -29,7 +29,7 @@ compile the TypeScript code and its dependencies into a single file
2929
in the `dist/` directory:
3030

3131
```sh
32-
npm run package
32+
pnpm package
3333
```
3434

3535
This approach is inspired by the [typescript-action](https://github.com/actions/typescript-action)
@@ -62,7 +62,7 @@ We use [Prettier](https://prettier.io/) to format TypeScript, Markdown, and YAML
6262
To format all files, run:
6363

6464
```sh
65-
npx prettier --write .
65+
pnpm prettier --write .
6666
```
6767

6868
### Linting
@@ -72,7 +72,7 @@ We use [ESLint](https://eslint.org/) for linting TypeScript files.
7272
To check for linting errors, run:
7373

7474
```sh
75-
npx eslint
75+
pnpm eslint
7676
```
7777

7878
### Testing
@@ -86,7 +86,7 @@ There are two types of tests running in [ci.yml](.github/workflows/ci.yml):
8686
To run these tests locally, run:
8787

8888
```sh
89-
npm run test
89+
pnpm test
9090
```
9191

9292
## Crates.io Documentation

0 commit comments

Comments
 (0)