| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
- releases/* |
| 8 |
pull_request: |
| 9 |
branches: |
| 10 |
- '*' |
| 11 |
|
| 12 |
jobs: |
| 13 |
cancel: |
| 14 |
name: Cancel previous jobs |
| 15 |
if: github.ref != 'refs/heads/master' |
| 16 |
runs-on: ubuntu-latest |
| 17 |
timeout-minutes: 3 |
| 18 |
steps: |
| 19 |
- name: Cancel previous jobs |
| 20 |
uses: styfle/[email protected] |
| 21 |
with: |
| 22 |
workflow_id: 4197767 |
| 23 |
access_token: ${{ github.token }} |
| 24 |
|
| 25 |
test: |
| 26 |
name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} |
| 27 |
if: always() |
| 28 |
needs: |
| 29 |
- cancel |
| 30 |
runs-on: ${{ matrix.os }} |
| 31 |
strategy: |
| 32 |
fail-fast: false |
| 33 |
matrix: |
| 34 |
node_version: [8, 10, 12, 14, 16] |
| 35 |
os: |
| 36 |
- ubuntu-latest |
| 37 |
- macos-latest |
| 38 |
- windows-latest |
| 39 |
steps: |
| 40 |
- name: Setup repository |
| 41 |
uses: actions/checkout@v2 |
| 42 |
- name: Setup environment |
| 43 |
uses: actions/setup-node@v1 |
| 44 |
with: |
| 45 |
node-version: ${{ matrix.node_version }} |
| 46 |
- name: Install dependencies |
| 47 |
run: npm install |
| 48 |
- name: Compile sources |
| 49 |
run: npm run compile |
| 50 |
- name: Run Hygiene Checks |
| 51 |
run: npm run lint |
| 52 |
- name: Run unit tests |
| 53 |
run: npm run test |
| 54 |
- name: Run smoke tests (sync) |
| 55 |
run: npm run smoke:sync |
| 56 |
- name: Run smoke tests (async) |
| 57 |
run: npm run smoke:async |
| 58 |
- name: Run smoke tests (stream) |
| 59 |
run: npm run smoke:stream |