Skip to content

Commit

Permalink
separate github actions for workspaces
Browse files Browse the repository at this point in the history
PR-URL: #4050
Credit: @fritzy
Close: #4050
Reviewed-by: @wraithgar

PR-URL: #4050
Credit: @fritzy
Close: #4050
Reviewed-by: @wraithgar
  • Loading branch information
fritzy committed Nov 18, 2021
1 parent ea2906c commit 44e39ce
Show file tree
Hide file tree
Showing 29 changed files with 162 additions and 50 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci-docs.yml
@@ -0,0 +1,52 @@
name: Node CI docs

on:
pull_request:
paths:
- docs/**
branches:
- '*'
push:
paths:
- docs/**
branches:
- release-next
- latest
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
# Checkout the npm/cli repo
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: npm
- name: Install dependencies
run: |
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
- name: Run linting
run: node ./bin/npm-cli.js run lint -w docs
env:
DEPLOY_VERSION: testing

check_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: npm
- name: Install dependencies
run: |
node ./bin/npm-cli.js install --ignore-scripts --no-audit
- name: Rebuild the docs
run: make freshdocs
- name: Git should not be dirty
run: node scripts/git-dirty.js
76 changes: 76 additions & 0 deletions .github/workflows/ci-libnpmdiff.yml
@@ -0,0 +1,76 @@
name: Node CI libnpmdiff

on:
pull_request:
paths:
- workspaces/libnpmdiff/**
branches:
- '*'
push:
paths:
- workspaces/libnpmdiff/**
branches:
- release-next
- latest
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
# Checkout the npm/cli repo
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: npm
- name: Install dependencies
run: |
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
- name: Run linting
run: node ./bin/npm-cli.js run posttest -w libnpmdiff
env:
DEPLOY_VERSION: testing

test:
strategy:
fail-fast: false
matrix:
node-version: ['12.13.0', 12.x, '14.15.0', 14.x, '16.0.0', 16.x]
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: bash
- os: windows-latest
shell: powershell

runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}

steps:
# Checkout the npm/cli repo
- uses: actions/checkout@v2

# Installs the specific version of Node.js
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm

# Run the installer script
- name: Install dependencies
run: |
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
# Run the tests, but not if we're just gonna do coveralls later anyway
- name: Run Tap tests
run: node ./bin/npm-cli.js run -w libnpmdiff --ignore-scripts test -- -t600 -Rbase -c
46 changes: 3 additions & 43 deletions .github/workflows/ci.yml
Expand Up @@ -8,6 +8,8 @@ on:
branches:
- release-next
- latest
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -106,49 +108,7 @@ jobs:
env:
DEPLOY_VERSION: testing

workspaces-tests:
strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x, 16.x]
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: bash
- os: windows-latest
shell: powershell

runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}

steps:
# Checkout the npm/cli repo
- uses: actions/checkout@v2

# Installs the specific version of Node.js
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm

# Run the installer script
- name: Install dependencies
run: |
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
- name: Run workspaces tests
run: node ./bin/npm-cli.js test -w ./packages -- --no-check-coverage -t600 -Rbase -c
env:
DEPLOY_VERSION: testing

build:
test:
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 3 additions & 1 deletion docs/package.json
Expand Up @@ -3,7 +3,9 @@
"description": "The npm cli documentation",
"version": "1.0.0",
"scripts": {
"build": "node dockhand"
"build": "node dockhand",
"eslint": "eslint",
"lint": "npm run eslint -- ./*.js"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion node_modules/libnpmdiff
28 changes: 25 additions & 3 deletions package-lock.json
Expand Up @@ -82,7 +82,7 @@
"license": "Artistic-2.0",
"workspaces": [
"docs",
"packages/*"
"workspaces/*"
],
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
Expand Down Expand Up @@ -4532,7 +4532,7 @@
}
},
"node_modules/libnpmdiff": {
"resolved": "packages/libnpmdiff",
"resolved": "workspaces/libnpmdiff",
"link": true
},
"node_modules/libnpmexec": {
Expand Down Expand Up @@ -10044,6 +10044,28 @@
}
},
"packages/libnpmdiff": {
"version": "2.0.4",
"extraneous": true,
"license": "ISC",
"dependencies": {
"@npmcli/disparity-colors": "^1.0.1",
"@npmcli/installed-package-contents": "^1.0.7",
"binary-extensions": "^2.2.0",
"diff": "^5.0.0",
"minimatch": "^3.0.4",
"npm-package-arg": "^8.1.4",
"pacote": "^12.0.0",
"tar": "^6.1.0"
},
"devDependencies": {
"eslint": "^8.1.0",
"tap": "^15.0.9"
},
"engines": {
"node": ">=10"
}
},
"workspaces/libnpmdiff": {
"version": "2.0.4",
"license": "ISC",
"dependencies": {
Expand Down Expand Up @@ -13321,7 +13343,7 @@
}
},
"libnpmdiff": {
"version": "file:packages/libnpmdiff",
"version": "file:workspaces/libnpmdiff",
"requires": {
"@npmcli/disparity-colors": "^1.0.1",
"@npmcli/installed-package-contents": "^1.0.7",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -4,7 +4,7 @@
"description": "a package manager for JavaScript",
"workspaces": [
"docs",
"packages/*"
"workspaces/*"
],
"files": [
"index.js",
Expand Down Expand Up @@ -217,7 +217,7 @@
"sudotest:nocleanup": "sudo NO_TEST_CLEANUP=1 npm run test --",
"posttest": "npm run lint",
"eslint": "eslint",
"lint": "npm run eslint -- bin docs lib scripts smoke-tests test ./*.js",
"lint": "npm run eslint -- bin lib scripts smoke-tests test ./*.js",
"lintfix": "npm run lint -- --fix",
"prelint": "rimraf test/npm_cache*",
"resetdeps": "bash scripts/resetdeps.sh",
Expand Down
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.
File renamed without changes.
File renamed without changes.

0 comments on commit 44e39ce

Please sign in to comment.