Skip to content

Commit 47b145b

Browse files
committed
separate github actions for workspaces
1 parent 9868e7e commit 47b145b

29 files changed

+162
-50
lines changed

.github/workflows/ci-docs.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Node CI docs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- docs/**
7+
branches:
8+
- '*'
9+
push:
10+
paths:
11+
- docs/**
12+
branches:
13+
- release-next
14+
- latest
15+
workflow_dispatch:
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
# Checkout the npm/cli repo
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js 14.x
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: 14.x
27+
cache: npm
28+
- name: Install dependencies
29+
run: |
30+
node ./bin/npm-cli.js install --ignore-scripts --no-audit
31+
node ./bin/npm-cli.js rebuild
32+
- name: Run linting
33+
run: node ./bin/npm-cli.js run lint -w docs
34+
env:
35+
DEPLOY_VERSION: testing
36+
37+
check_docs:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Use Node.js 14.x
42+
uses: actions/setup-node@v2
43+
with:
44+
node-version: 14.x
45+
cache: npm
46+
- name: Install dependencies
47+
run: |
48+
node ./bin/npm-cli.js install --ignore-scripts --no-audit
49+
- name: Rebuild the docs
50+
run: make freshdocs
51+
- name: Git should not be dirty
52+
run: node scripts/git-dirty.js

.github/workflows/ci-libnpmdiff.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Node CI libnpmdiff
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- workspaces/libnpmdiff/**
7+
branches:
8+
- '*'
9+
push:
10+
paths:
11+
- workspaces/libnpmdiff/**
12+
branches:
13+
- release-next
14+
- latest
15+
workflow_dispatch:
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
# Checkout the npm/cli repo
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js 14.x
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: 14.x
27+
cache: npm
28+
- name: Install dependencies
29+
run: |
30+
node ./bin/npm-cli.js install --ignore-scripts --no-audit
31+
node ./bin/npm-cli.js rebuild
32+
- name: Run linting
33+
run: node ./bin/npm-cli.js run posttest -w libnpmdiff
34+
env:
35+
DEPLOY_VERSION: testing
36+
37+
test:
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
node-version: ['12.13.0', 12.x, '14.15.0', 14.x, '16.0.0', 16.x]
42+
platform:
43+
- os: ubuntu-latest
44+
shell: bash
45+
- os: macos-latest
46+
shell: bash
47+
- os: windows-latest
48+
shell: bash
49+
- os: windows-latest
50+
shell: powershell
51+
52+
runs-on: ${{ matrix.platform.os }}
53+
defaults:
54+
run:
55+
shell: ${{ matrix.platform.shell }}
56+
57+
steps:
58+
# Checkout the npm/cli repo
59+
- uses: actions/checkout@v2
60+
61+
# Installs the specific version of Node.js
62+
- name: Use Node.js ${{ matrix.node-version }}
63+
uses: actions/setup-node@v2
64+
with:
65+
node-version: ${{ matrix.node-version }}
66+
cache: npm
67+
68+
# Run the installer script
69+
- name: Install dependencies
70+
run: |
71+
node ./bin/npm-cli.js install --ignore-scripts --no-audit
72+
node ./bin/npm-cli.js rebuild
73+
74+
# Run the tests, but not if we're just gonna do coveralls later anyway
75+
- name: Run Tap tests
76+
run: node ./bin/npm-cli.js run -w libnpmdiff --ignore-scripts test -- -t600 -Rbase -c

.github/workflows/ci.yml

+3-43
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
branches:
99
- release-next
1010
- latest
11+
workflow_dispatch:
12+
1113
jobs:
1214
lint:
1315
runs-on: ubuntu-latest
@@ -106,49 +108,7 @@ jobs:
106108
env:
107109
DEPLOY_VERSION: testing
108110

109-
workspaces-tests:
110-
strategy:
111-
fail-fast: false
112-
matrix:
113-
node-version: [12.x, 14.x, 16.x]
114-
platform:
115-
- os: ubuntu-latest
116-
shell: bash
117-
- os: macos-latest
118-
shell: bash
119-
- os: windows-latest
120-
shell: bash
121-
- os: windows-latest
122-
shell: powershell
123-
124-
runs-on: ${{ matrix.platform.os }}
125-
defaults:
126-
run:
127-
shell: ${{ matrix.platform.shell }}
128-
129-
steps:
130-
# Checkout the npm/cli repo
131-
- uses: actions/checkout@v2
132-
133-
# Installs the specific version of Node.js
134-
- name: Use Node.js ${{ matrix.node-version }}
135-
uses: actions/setup-node@v2
136-
with:
137-
node-version: ${{ matrix.node-version }}
138-
cache: npm
139-
140-
# Run the installer script
141-
- name: Install dependencies
142-
run: |
143-
node ./bin/npm-cli.js install --ignore-scripts --no-audit
144-
node ./bin/npm-cli.js rebuild
145-
146-
- name: Run workspaces tests
147-
run: node ./bin/npm-cli.js test -w ./packages -- --no-check-coverage -t600 -Rbase -c
148-
env:
149-
DEPLOY_VERSION: testing
150-
151-
build:
111+
test:
152112
strategy:
153113
fail-fast: false
154114
matrix:

docs/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"description": "The npm cli documentation",
44
"version": "1.0.0",
55
"scripts": {
6-
"build": "node dockhand"
6+
"build": "node dockhand",
7+
"eslint": "eslint",
8+
"lint": "npm run eslint -- ./*.js"
79
},
810
"repository": {
911
"type": "git",

node_modules/libnpmdiff

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../packages/libnpmdiff
1+
../workspaces/libnpmdiff

package-lock.json

+25-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"license": "Artistic-2.0",
8383
"workspaces": [
8484
"docs",
85-
"packages/*"
85+
"workspaces/*"
8686
],
8787
"dependencies": {
8888
"@isaacs/string-locale-compare": "^1.1.0",
@@ -4532,7 +4532,7 @@
45324532
}
45334533
},
45344534
"node_modules/libnpmdiff": {
4535-
"resolved": "packages/libnpmdiff",
4535+
"resolved": "workspaces/libnpmdiff",
45364536
"link": true
45374537
},
45384538
"node_modules/libnpmexec": {
@@ -10044,6 +10044,28 @@
1004410044
}
1004510045
},
1004610046
"packages/libnpmdiff": {
10047+
"version": "2.0.4",
10048+
"extraneous": true,
10049+
"license": "ISC",
10050+
"dependencies": {
10051+
"@npmcli/disparity-colors": "^1.0.1",
10052+
"@npmcli/installed-package-contents": "^1.0.7",
10053+
"binary-extensions": "^2.2.0",
10054+
"diff": "^5.0.0",
10055+
"minimatch": "^3.0.4",
10056+
"npm-package-arg": "^8.1.4",
10057+
"pacote": "^12.0.0",
10058+
"tar": "^6.1.0"
10059+
},
10060+
"devDependencies": {
10061+
"eslint": "^8.1.0",
10062+
"tap": "^15.0.9"
10063+
},
10064+
"engines": {
10065+
"node": ">=10"
10066+
}
10067+
},
10068+
"workspaces/libnpmdiff": {
1004710069
"version": "2.0.4",
1004810070
"license": "ISC",
1004910071
"dependencies": {
@@ -13321,7 +13343,7 @@
1332113343
}
1332213344
},
1332313345
"libnpmdiff": {
13324-
"version": "file:packages/libnpmdiff",
13346+
"version": "file:workspaces/libnpmdiff",
1332513347
"requires": {
1332613348
"@npmcli/disparity-colors": "^1.0.1",
1332713349
"@npmcli/installed-package-contents": "^1.0.7",

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "a package manager for JavaScript",
55
"workspaces": [
66
"docs",
7-
"packages/*"
7+
"workspaces/*"
88
],
99
"files": [
1010
"index.js",
@@ -217,7 +217,7 @@
217217
"sudotest:nocleanup": "sudo NO_TEST_CLEANUP=1 npm run test --",
218218
"posttest": "npm run lint",
219219
"eslint": "eslint",
220-
"lint": "npm run eslint -- bin docs lib scripts smoke-tests test ./*.js",
220+
"lint": "npm run eslint -- bin lib scripts smoke-tests test ./*.js",
221221
"lintfix": "npm run lint -- --fix",
222222
"prelint": "rimraf test/npm_cache*",
223223
"resetdeps": "bash scripts/resetdeps.sh",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)