Skip to content

Commit ced8abe

Browse files
committed
ci: Update to pnpm for faster CI/CD and local development workflow
1 parent fcf9959 commit ced8abe

File tree

15 files changed

+14522
-78
lines changed

15 files changed

+14522
-78
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,16 @@ jobs:
1616
persist-credentials: false # https://stackoverflow.com/questions/74744498/github-pushing-to-protected-branches-with-fine-grained-token
1717

1818
- name: Setup node
19-
uses: actions/setup-node@v2
19+
uses: actions/setup-node@v4
2020
env:
2121
NPM_TOKEN: '' # https://github.com/JS-DevTools/npm-publish/issues/15
2222
with:
23-
cache-dependency-path: package.json # we don't have a package-lock.json so we'll use this instead...
2423
node-version: '18'
2524

26-
- name: Run `npm install --no-package-lock --no-fund` on cli-output-helpers
27-
run: npm install --no-package-lock --no-fund
28-
working-directory: tools/cli-output-helpers
29-
30-
- name: Build cli-output-helpers
31-
run: npm run build
32-
working-directory: tools/cli-output-helpers
33-
34-
- name: Run `npm install --no-package-lock --no-fund` on nevermore-template-helpers
35-
run: npm install --no-package-lock --no-fund
36-
working-directory: tools/nevermore-template-helpers
37-
38-
- name: Build nevermore-template-helpers
39-
run: npm run build
40-
working-directory: tools/nevermore-template-helpers
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@v4
27+
with:
28+
cache: true
4129

4230
- name: Setup npm for GitHub Packages
4331
run: |
@@ -49,16 +37,11 @@ jobs:
4937
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5038
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5139

52-
- name: Run `npm install --no-package-lock` on nevermore-cli
53-
run: npm install --no-package-lock
54-
working-directory: tools/nevermore-cli
55-
56-
- name: Build nevermore-cli
57-
run: npm run build
58-
working-directory: tools/nevermore-cli
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
5942

60-
- name: Run npm install
61-
run: npm install --no-save --no-fund
43+
- name: Build all tools
44+
run: pnpm -r --filter './tools/**' run build
6245

6346
- name: Git reset .npmrc
6447
run: git checkout .npmrc

.github/workflows/linting.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
with:
1313
version: 'v0.3.0'
1414
token: ${{ secrets.GITHUB_TOKEN }}
15+
cache: true
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
cache: true
1521

1622
- name: Setup npm for GitHub Packages
1723
run: |
@@ -23,37 +29,16 @@ jobs:
2329
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2430
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2531

26-
- name: Run `npm install --no-package-lock` on cli-output-helpers
27-
run: npm install --no-package-lock --no-fund
28-
working-directory: tools/cli-output-helpers
29-
30-
- name: Build cli-output-helpers
31-
run: npm run build
32-
working-directory: tools/cli-output-helpers
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
3334

34-
- name: Run `npm install --no-package-lockd` on nevermore-template-helpers
35-
run: npm install --no-package-lock --no-fund
36-
working-directory: tools/nevermore-template-helpers
37-
38-
- name: Build nevermore-template-helpers
39-
run: npm run build
40-
working-directory: tools/nevermore-template-helpers
41-
42-
- name: Run `npm install --no-package-lock` on nevermore-cli
43-
run: npm install --no-package-lock --no-fund
44-
working-directory: tools/nevermore-cli
45-
46-
- name: Build nevermore-cli
47-
run: npm run build
48-
working-directory: tools/nevermore-cli
35+
- name: Build all tools
36+
run: pnpm -r --filter './tools/**' --filter '!./tools/nevermore-vscode' run build
4937

5038
- name: Install nevermore-cli locally
5139
run: npm install -g .
5240
working-directory: tools/nevermore-cli
5341

54-
- name: Link and install packages
55-
run: npm run build:link
56-
5742
- name: Generate Sourcemap
5843
run: npm run build:sourcemap
5944

@@ -71,6 +56,7 @@ jobs:
7156
with:
7257
version: 'v0.3.0'
7358
token: ${{ secrets.GITHUB_TOKEN }}
59+
cache: true
7460

7561
- name: stylua check
7662
run: npm run lint:stylua
@@ -86,6 +72,7 @@ jobs:
8672
with:
8773
version: 'v0.3.0'
8874
token: ${{ secrets.GITHUB_TOKEN }}
75+
cache: true
8976

9077
- name: selene check
9178
run: npm run lint:selene
@@ -101,6 +88,7 @@ jobs:
10188
with:
10289
version: 'v0.3.0'
10390
token: ${{ secrets.GITHUB_TOKEN }}
91+
cache: true
10492

10593
- name: Run moonwave-extractor
10694
run: npm run lint:moonwave

.github/workflows/tests.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ jobs:
66
steps:
77
- name: Checkout repository
88
uses: actions/checkout@v6
9-
with:
10-
fetch-depth: 0
119

1210
- name: Setup node
13-
uses: actions/setup-node@v2
11+
uses: actions/setup-node@v4
1412
with:
1513
cache-dependency-path: package.json
1614
node-version: '18'
1715

16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
with:
19+
cache: true
20+
1821
- name: Install GitHub CLI
1922
run: |
2023
sudo apt update
@@ -30,12 +33,8 @@ jobs:
3033
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3134
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3235

33-
- name: Install package dependencies
34-
run: |
35-
echo "Installing package dependencies..."
36-
npx lerna exec -- npm install --no-audit --no-fund
37-
PACKAGES=$(npx lerna ls --since origin/main --json | jq -r '.[] | select(.name != "@quenty/nevermore-cli") | .location' | tr '\n' ' ')
38-
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
36+
- name: Install dependencies
37+
run: pnpm install --frozen-lockfile
3938

4039
- name: Setup test place project
4140
run: |
@@ -55,6 +54,7 @@ jobs:
5554
path: tests/bin
5655
version: 'v0.3.0'
5756
token: ${{ secrets.GITHUB_TOKEN }}
57+
cache: true
5858

5959
- name: Generate test place file
6060
run: rojo build default.project.json -o testBuild.rbxl

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ dist
1212
.DS_Store
1313
globalTypes.d.lua
1414
*.vsix
15+
tests/bin
1516

1617
# Normally it's a good idea to commit this. However, in this mono-repo scenario with linking
17-
# it adds a ton of noise and no real gain. Also we have seen no gains from reproducing
18-
# builds so we don't have a strict need for this right now.
19-
package-lock.json
20-
tests/bin
18+
# it adds a ton of noise and no real gain. Instead, we rely upon pnpm-lock.yaml which is less messy.
19+
package-lock.json

.npmrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
package-lock = false

lerna.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
"packages": [
3-
"src/*",
4-
"tools/*"
5-
],
2+
"npmClient": "pnpm",
3+
"packages": ["src/*", "tools/*"],
64
"command": {
75
"publish": {
86
"verifyAccess": false

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@quenty/nevermore",
33
"private": true,
4+
"packageManager": "pnpm@10.27.0",
45
"repository": {
56
"type": "git",
67
"url": "https://github.com/Quenty/NevermoreEngine.git"
@@ -13,17 +14,17 @@
1314
"@auto-it/released": "^v11.0.4",
1415
"auto": "^v11.0.4",
1516
"lerna": "^7.1.4",
16-
"moonwave": "^1.1.2"
17+
"moonwave": "^1.1.2",
18+
"pnpm": "^10.27.0"
1719
},
1820
"scripts": {
19-
"build:link": "npx lerna exec --parallel -- npm install --no-package-lock --no-audit --no-fund",
21+
"build:link": "pnpm install",
2022
"build:sourcemap": "rojo sourcemap default.project.json --output sourcemap.json --absolute",
2123
"format": "stylua --config-path=stylua.toml src games tests plugins",
2224
"lint:luau": "luau-lsp analyze --sourcemap=sourcemap.json --base-luaurc=.luaurc --defs=globalTypes.d.lua --flag:LuauSolverV2=false --ignore=**/node_modules/** --ignore=**/*.story.lua --ignore=**/*.client.lua --ignore=**/*.server.lua src",
2325
"lint:moonwave": "npx lerna exec --parallel -- moonwave-extractor extract src",
2426
"lint:selene": "npx lerna exec --parallel -- selene --no-summary --num-threads=1 --config=../../selene.toml src",
2527
"lint:stylua": "stylua --config-path=stylua.toml --check src games tests plugins",
26-
"postinstall": "npm run build:link",
2728
"prelint:luau": "npm run build:sourcemap && npx @quenty/nevermore-cli download-roblox-types",
2829
"prelint:selene": "selene generate-roblox-std",
2930
"release": "auto shipit"

0 commit comments

Comments
 (0)