Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[tests] separate tests from linting and license validation
PR-URL: #2682
Credit: @ljharb
Close: #2682
Reviewed-by: @wraithgar
  • Loading branch information
ljharb authored and wraithgar committed Feb 12, 2021
1 parent 3a159d2 commit abcc96a
Show file tree
Hide file tree
Showing 3 changed files with 519 additions and 14 deletions.
57 changes: 43 additions & 14 deletions .github/workflows/ci.yml
Expand Up @@ -3,20 +3,54 @@ name: Node CI
on: [push, pull_request]

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@v1
with:
node-version: 14.x
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild
- name: Run linting
run: node . run posttest
env:
DEPLOY_VERSION: testing

licenses:
runs-on: ubuntu-latest
steps:
# Checkout the npm/cli repo
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild
- name: Run linting
run: node . run licenses

build:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: bash
- os: windows-latest
shell: powershell
- 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:
Expand All @@ -42,7 +76,7 @@ jobs:
# Run the tests, but not if we're just gonna do coveralls later anyway
- name: Run Tap tests
if: matrix.platform.os != 'ubuntu-latest' || matrix.node-version != '12.x'
run: node . test -- -t600 -Rbase -c
run: node . run --ignore-scripts test -- -t600 -Rbase -c
env:
DEPLOY_VERSION: testing

Expand All @@ -58,8 +92,3 @@ jobs:
# - name: Run sudo tests on Linux
# if: matrix.os == 'ubuntu-latest'
# run: sudo PATH=$PATH $(which node) . test -- --coverage --timeout 600

# no need to check licenses everywhere, they don't change between versions
- name: Validate licenses
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '12.x'
run: node . run licenses

0 comments on commit abcc96a

Please sign in to comment.