2021-01-31 23:30:20 +01:00
|
|
|
name: 'CI'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-02-01 00:28:30 +01:00
|
|
|
tags:
|
|
|
|
- '**'
|
2021-01-31 23:30:20 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2021-01-31 23:39:06 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2023-09-28 12:14:44 +02:00
|
|
|
node: ['18', '20']
|
2021-01-31 23:30:20 +01:00
|
|
|
|
|
|
|
steps:
|
2023-09-28 12:07:29 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2021-01-31 23:30:20 +01:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2023-09-28 22:16:51 +02:00
|
|
|
cache: npm
|
2021-01-31 23:30:20 +01:00
|
|
|
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm test
|
|
|
|
- run: npm run build
|
2021-02-01 00:18:54 +01:00
|
|
|
|
2023-09-28 22:16:51 +02:00
|
|
|
coverage:
|
|
|
|
if: ${{ github.actor != 'dependabot[bot]' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
cache: npm
|
|
|
|
- run: npm ci
|
|
|
|
- uses: paambaati/codeclimate-action@v5.0.0
|
|
|
|
env:
|
|
|
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
|
|
with:
|
|
|
|
coverageCommand: npm test
|
|
|
|
|
2021-02-01 00:18:54 +01:00
|
|
|
publish:
|
|
|
|
needs: test
|
|
|
|
if: success() && startsWith(github.ref, 'refs/tags')
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-28 12:07:29 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2021-02-01 00:18:54 +01:00
|
|
|
with:
|
|
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm publish
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|