2020-04-20 22:50:53 +00:00
|
|
|
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
|
|
|
|
|
|
name: Node CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: build, test, check coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-09-22 22:27:58 +00:00
|
|
|
node-version: [10, 12, 14]
|
2020-04-20 22:50:53 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
- name: install
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
- name: test
|
|
|
|
run: npm test
|
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# publication:
|
|
|
|
# needs: build
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - uses: EndBug/version-check@v1
|
|
|
|
# id: check
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - name: check version changes
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - uses: actions/setup-node@v1
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# with:
|
|
|
|
# node-version: 14
|
|
|
|
# registry-url: https://registry.npmjs.org/
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - name: install
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# run: npm ci
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - name: build
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# run: npm run build
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - name: test
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# run: npm test
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - name: create code coverage report
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# run: npm run coverage
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - name: send report to coveralls.io
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# uses: coverallsapp/github-action@master
|
|
|
|
# with:
|
|
|
|
# github-token: ${{ secrets.GITHUB_TOKEN }}
|
2020-04-20 22:50:53 +00:00
|
|
|
|
2021-03-25 12:40:04 +00:00
|
|
|
# - name: publish to NPM
|
|
|
|
# if: steps.check.outputs.changed == 'true'
|
|
|
|
# run: npm publish
|
|
|
|
# env:
|
|
|
|
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|