| 1 |
name: CI |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
test: |
| 7 |
strategy: |
| 8 |
fail-fast: false |
| 9 |
matrix: |
| 10 |
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x] |
| 11 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 12 |
exclude: |
| 13 |
- os: macos-latest |
| 14 |
node-version: 10.x |
| 15 |
- os: macos-latest |
| 16 |
node-version: 12.x |
| 17 |
- os: macos-latest |
| 18 |
node-version: 14.x |
| 19 |
|
| 20 |
runs-on: ${{ matrix.os }} |
| 21 |
|
| 22 |
steps: |
| 23 |
- name: Set core.autocrlf on windows |
| 24 |
if: matrix.os == 'windows-latest' |
| 25 |
run: git config --global core.autocrlf true |
| 26 |
|
| 27 |
- uses: actions/checkout@v3 |
| 28 |
|
| 29 |
- name: Use Node.js ${{ matrix.node-version }} |
| 30 |
uses: actions/setup-node@v3 |
| 31 |
with: |
| 32 |
node-version: ${{ matrix.node-version }} |
| 33 |
cache: 'npm' |
| 34 |
|
| 35 |
- name: Install dependencies |
| 36 |
run: npm install |
| 37 |
|
| 38 |
- name: Install jest for node < 14 |
| 39 |
if: matrix.node-version == '10.x' || matrix.node-version == '12.x' |
| 40 |
run: npm install jest@^27.5.1 |
| 41 |
|
| 42 |
- name: Set debug on windows |
| 43 |
if: matrix.os == 'windows-latest' |
| 44 |
run: set DEBUG=* |
| 45 |
|
| 46 |
- run: npm test |
| 47 |
|
| 48 |
test-types: |
| 49 |
runs-on: ubuntu-latest |
| 50 |
steps: |
| 51 |
- uses: actions/checkout@v3 |
| 52 |
- name: Use Node.js 20.x |
| 53 |
uses: actions/setup-node@v3 |
| 54 |
with: |
| 55 |
node-version: 20.x |
| 56 |
cache: 'npm' |
| 57 |
|
| 58 |
- name: Install dependencies |
| 59 |
run: npm install |
| 60 |
|
| 61 |
- name: Install typescript |
| 62 |
run: npm install --save-dev typescript |
| 63 |
|
| 64 |
- run: node_modules/.bin/tsc --strict --lib es2015 lib/portfinder.d.ts |