Skip to content

Commit abcc96a

Browse files
ljharbwraithgar
authored andcommitted
[tests] separate tests from linting and license validation
PR-URL: npm#2682 Credit: @ljharb Close: npm#2682 Reviewed-by: @wraithgar
1 parent 3a159d2 commit abcc96a

File tree

3 files changed

+519
-14
lines changed

3 files changed

+519
-14
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,54 @@ name: Node CI
33
on: [push, pull_request]
44

55
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
# Checkout the npm/cli repo
10+
- uses: actions/checkout@v2
11+
- name: Use Node.js 14.x
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 14.x
15+
- name: Install dependencies
16+
run: |
17+
node . install --ignore-scripts --no-audit
18+
node . rebuild
19+
- name: Run linting
20+
run: node . run posttest
21+
env:
22+
DEPLOY_VERSION: testing
23+
24+
licenses:
25+
runs-on: ubuntu-latest
26+
steps:
27+
# Checkout the npm/cli repo
28+
- uses: actions/checkout@v2
29+
- name: Use Node.js 14.x
30+
uses: actions/setup-node@v1
31+
with:
32+
node-version: 14.x
33+
- name: Install dependencies
34+
run: |
35+
node . install --ignore-scripts --no-audit
36+
node . rebuild
37+
- name: Run linting
38+
run: node . run licenses
39+
640
build:
741
strategy:
842
fail-fast: false
943
matrix:
1044
node-version: [10.x, 12.x, 14.x]
1145
platform:
12-
- os: ubuntu-latest
13-
shell: bash
14-
- os: macos-latest
15-
shell: bash
16-
- os: windows-latest
17-
shell: bash
18-
- os: windows-latest
19-
shell: powershell
46+
- os: ubuntu-latest
47+
shell: bash
48+
- os: macos-latest
49+
shell: bash
50+
- os: windows-latest
51+
shell: bash
52+
- os: windows-latest
53+
shell: powershell
2054

2155
runs-on: ${{ matrix.platform.os }}
2256
defaults:
@@ -42,7 +76,7 @@ jobs:
4276
# Run the tests, but not if we're just gonna do coveralls later anyway
4377
- name: Run Tap tests
4478
if: matrix.platform.os != 'ubuntu-latest' || matrix.node-version != '12.x'
45-
run: node . test -- -t600 -Rbase -c
79+
run: node . run --ignore-scripts test -- -t600 -Rbase -c
4680
env:
4781
DEPLOY_VERSION: testing
4882

@@ -58,8 +92,3 @@ jobs:
5892
# - name: Run sudo tests on Linux
5993
# if: matrix.os == 'ubuntu-latest'
6094
# run: sudo PATH=$PATH $(which node) . test -- --coverage --timeout 600
61-
62-
# no need to check licenses everywhere, they don't change between versions
63-
- name: Validate licenses
64-
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '12.x'
65-
run: node . run licenses

0 commit comments

Comments
 (0)