|
| 1 | +# This file is automatically added by @npmcli/template-oss. Do not edit. |
| 2 | + |
1 | 3 | name: CI
|
2 |
| -on: [push, pull_request] |
| 4 | + |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + - latest |
| 11 | + schedule: |
| 12 | + # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 |
| 13 | + - cron: "0 2 * * 1" |
| 14 | + |
3 | 15 | jobs:
|
| 16 | + lint: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + - uses: actions/setup-node@v2 |
| 21 | + with: |
| 22 | + node-version: '16' |
| 23 | + - run: npm i --prefer-online -g npm@latest |
| 24 | + - run: npm i |
| 25 | + - run: npm run lint |
| 26 | + |
4 | 27 | test:
|
5 | 28 | strategy:
|
6 | 29 | fail-fast: false
|
7 | 30 | matrix:
|
8 |
| - node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x] |
9 |
| - |
10 |
| - runs-on: ubuntu-latest |
| 31 | + node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x] |
| 32 | + platform: |
| 33 | + - os: ubuntu-latest |
| 34 | + shell: bash |
| 35 | + - os: macos-latest |
| 36 | + shell: bash |
| 37 | + - os: windows-latest |
| 38 | + shell: cmd |
| 39 | + runs-on: ${{ matrix.platform.os }} |
| 40 | + defaults: |
| 41 | + run: |
| 42 | + shell: ${{ matrix.platform.shell }} |
11 | 43 | steps:
|
12 |
| - - uses: actions/checkout@v2 |
13 |
| - - name: Use Node.js ${{ matrix.node-version }} |
14 |
| - uses: actions/setup-node@v2 |
15 |
| - with: |
16 |
| - node-version: ${{ matrix.node-version }} |
17 |
| - - name: Update npm |
18 |
| - run: npm i -g npm@7 |
19 |
| - - name: Install dependencies |
20 |
| - run: npm ci |
21 |
| - - name: Run Tap tests |
22 |
| - run: npm test |
| 44 | + - uses: actions/checkout@v2 |
| 45 | + - uses: actions/setup-node@v2 |
| 46 | + with: |
| 47 | + node-version: ${{ matrix.node-version }} |
| 48 | + # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows |
| 49 | + - name: Update to workable npm (windows) |
| 50 | + if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14')) |
| 51 | + run: | |
| 52 | + curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz |
| 53 | + tar xf npm-7.5.4.tgz |
| 54 | + cd package |
| 55 | + node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz |
| 56 | + cd .. |
| 57 | + rmdir /s /q package |
| 58 | + - name: Update npm |
| 59 | + run: npm i --prefer-online --no-fund --no-audit -g npm@latest |
| 60 | + - run: npm -v |
| 61 | + - run: npm i |
| 62 | + - run: npm test --ignore-scripts |
0 commit comments