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