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