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]
|
|
|
|
node: ['14']
|
2020-02-24 01:12:01 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-02-01 00:03:55 +01:00
|
|
|
- uses: actions/setup-node@v2
|
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:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
- run: npm ci
|
|
|
|
- uses: paambaati/codeclimate-action@v2.7.5
|
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:
|
|
|
|
- uses: actions/checkout@v2
|
2021-02-01 00:03:55 +01:00
|
|
|
- uses: actions/setup-node@v2
|
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 }}
|