Skip to content

Commit 8ec5a4c

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

File tree

17 files changed

+14536
-94
lines changed

17 files changed

+14536
-94
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,14 @@ 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
20-
env:
21-
NPM_TOKEN: '' # https://github.com/JS-DevTools/npm-publish/issues/15
19+
uses: actions/setup-node@v6
2220
with:
23-
cache-dependency-path: package.json # we don't have a package-lock.json so we'll use this instead...
24-
node-version: '18'
25-
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
21+
node-version: '21'
3322

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
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
cache: true
4127

4228
- name: Setup npm for GitHub Packages
4329
run: |
@@ -49,16 +35,11 @@ jobs:
4935
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5036
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5137

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
38+
- name: Install dependencies
39+
run: pnpm install --frozen-lockfile
5940

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

6344
- name: Git reset .npmrc
6445
run: git checkout .npmrc

.github/workflows/docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ jobs:
99
name: Build and deploy docs
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v6
13-
- uses: actions/setup-node@v2
12+
- name: Setup node
13+
uses: actions/setup-node@v6
1414
with:
15-
node-version: '18'
15+
node-version: '21'
16+
1617
- run: npm i -g moonwave@latest
1718
- name: Publish
1819
run: |

.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: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@ 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@v6
1412
with:
15-
cache-dependency-path: package.json
16-
node-version: '18'
13+
node-version: '21'
1714

18-
- name: Install GitHub CLI
19-
run: |
20-
sudo apt update
21-
sudo apt install gh -y
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
with:
18+
cache: true
2219

2320
- name: Setup npm for GitHub Packages
2421
run: |
@@ -30,31 +27,31 @@ jobs:
3027
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3128
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3229

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
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
3932

4033
- name: Setup test place project
4134
run: |
4235
echo "Setting up test place project from template..."
4336
cp -r tests/test-place-template tests/bin
4437
cd tests/bin
4538
46-
echo "Installing changed packages..."
47-
npm i ${{ env.PACKAGES }}
39+
echo "Installing all Nevermore packages..."
40+
# Get all @quenty workspace packages and add them
41+
pnpm -r list --depth=-1 --json --filter '@quenty/*' | \
42+
jq -r '.[].name' | \
43+
xargs pnpm add --workspace
4844
49-
echo "Installing Jest"
50-
npm i https://github.com/quentystudios/jest-lua.git
45+
echo "Installing Jest..."
46+
pnpm add https://github.com/quentystudios/jest-lua.git
5147
5248
- name: Setup Aftman
5349
uses: ok-nick/setup-aftman@v0.4.2
5450
with:
5551
path: tests/bin
5652
version: 'v0.3.0'
5753
token: ${{ secrets.GITHUB_TOKEN }}
54+
cache: true
5855

5956
- name: Generate test place file
6057
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)