From 44e39ce7042a162f53a708ee4660e84638a66f6b Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Tue, 16 Nov 2021 10:27:55 -0800 Subject: separate github actions for workspaces PR-URL: https://github.com/npm/cli/pull/4050 Credit: @fritzy Close: #4050 Reviewed-by: @wraithgar PR-URL: https://github.com/npm/cli/pull/4050 Credit: @fritzy Close: #4050 Reviewed-by: @wraithgar --- .github/workflows/ci-docs.yml | 52 +++++++++++++++++++++++++ .github/workflows/ci-libnpmdiff.yml | 76 +++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 46 ++-------------------- 3 files changed, 131 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/ci-docs.yml create mode 100644 .github/workflows/ci-libnpmdiff.yml (limited to '.github') diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml new file mode 100644 index 000000000..67a075227 --- /dev/null +++ b/.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 diff --git a/.github/workflows/ci-libnpmdiff.yml b/.github/workflows/ci-libnpmdiff.yml new file mode 100644 index 000000000..5f8a20f64 --- /dev/null +++ b/.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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fba2a3ba..473e30f37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,8 @@ on: branches: - release-next - latest + workflow_dispatch: + jobs: lint: runs-on: ubuntu-latest @@ -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: -- cgit v1.2.3