|
1 | | -name: node-ci |
| 1 | +# This file is automatically added by @npmcli/template-oss. Do not edit. |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +name: CI |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '*' |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + - latest |
| 14 | + schedule: |
| 15 | + # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 |
| 16 | + - cron: "0 2 * * 1" |
4 | 17 |
|
5 | 18 | jobs: |
6 | | - build: |
| 19 | + lint: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v3 |
| 23 | + - name: Setup git user |
| 24 | + run: | |
| 25 | + git config --global user.email "[email protected]" |
| 26 | + git config --global user.name "npm cli ops bot" |
| 27 | + - uses: actions/setup-node@v3 |
| 28 | + with: |
| 29 | + node-version: 16.x |
| 30 | + - name: Update npm to latest |
| 31 | + run: npm i --prefer-online --no-fund --no-audit -g npm@latest |
| 32 | + - run: npm -v |
| 33 | + - run: npm i --ignore-scripts |
| 34 | + - run: npm run lint |
| 35 | + |
| 36 | + test: |
7 | 37 | strategy: |
| 38 | + fail-fast: false |
8 | 39 | matrix: |
9 | | - node-version: [10.0.x, 10.x, 12.0.x, 12.x, 14.0.x, 14.x, 15.x, 16.x] |
| 40 | + node-version: |
| 41 | + - 12.13.0 |
| 42 | + - 12.x |
| 43 | + - 14.15.0 |
| 44 | + - 14.x |
| 45 | + - 16.0.0 |
| 46 | + - 16.x |
10 | 47 | platform: |
11 | | - - os: ubuntu-latest |
12 | | - shell: bash |
13 | | - - os: macos-latest |
14 | | - shell: bash |
15 | | - - os: windows-latest |
16 | | - shell: bash |
17 | | - - os: windows-latest |
18 | | - shell: powershell |
19 | | - |
| 48 | + - os: ubuntu-latest |
| 49 | + shell: bash |
| 50 | + - os: macos-latest |
| 51 | + shell: bash |
| 52 | + - os: windows-latest |
| 53 | + shell: cmd |
20 | 54 | runs-on: ${{ matrix.platform.os }} |
21 | 55 | defaults: |
22 | 56 | run: |
23 | 57 | shell: ${{ matrix.platform.shell }} |
24 | | - |
25 | 58 | steps: |
26 | | - - name: Checkout Repository |
27 | | - |
28 | | - |
29 | | - - name: Use Nodejs ${{ matrix.node-version }} |
30 | | - uses: actions/setup-node@v1 |
| 59 | + - uses: actions/checkout@v3 |
| 60 | + - name: Setup git user |
| 61 | + run: | |
| 62 | + git config --global user.email "[email protected]" |
| 63 | + git config --global user.name "npm cli ops bot" |
| 64 | + - uses: actions/setup-node@v3 |
31 | 65 | with: |
32 | 66 | node-version: ${{ matrix.node-version }} |
33 | | - |
34 | | - - name: Update npm |
35 | | - run: npm i -g npm@latest |
36 | | - |
37 | | - - name: Install dependencies |
38 | | - run: npm ci |
39 | | - |
40 | | - - name: Run Tap Tests |
41 | | - run: npm test |
| 67 | + - name: Update to workable npm (windows) |
| 68 | + # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows |
| 69 | + if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.')) |
| 70 | + run: | |
| 71 | + curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz |
| 72 | + tar xf npm-7.5.4.tgz |
| 73 | + cd package |
| 74 | + node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz |
| 75 | + cd .. |
| 76 | + rmdir /s /q package |
| 77 | + - name: Update npm to 7 |
| 78 | + # If we do test on npm 10 it needs npm7 |
| 79 | + if: startsWith(matrix.node-version, '10.') |
| 80 | + run: npm i --prefer-online --no-fund --no-audit -g npm@7 |
| 81 | + - name: Update npm to latest |
| 82 | + if: ${{ !startsWith(matrix.node-version, '10.') }} |
| 83 | + run: npm i --prefer-online --no-fund --no-audit -g npm@latest |
| 84 | + - run: npm -v |
| 85 | + - run: npm i --ignore-scripts |
| 86 | + - run: npm test --ignore-scripts |
0 commit comments