2019-11-06 13:14:09 +01:00
|
|
|
name: CI
|
|
|
|
|
2019-12-03 23:52:39 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- "2.9"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- "2.9"
|
2019-11-06 13:14:09 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2020-12-05 16:57:19 +01:00
|
|
|
outputs:
|
|
|
|
coveralls: ${{ steps.changes.outputs.src }}
|
|
|
|
|
2019-11-06 13:14:09 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-12-03 23:52:39 +01:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
2019-11-06 13:14:09 +01:00
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
steps:
|
2020-02-27 18:28:11 +01:00
|
|
|
- uses: actions/checkout@v2
|
2019-11-06 13:14:09 +01:00
|
|
|
- name: Use Node.js
|
|
|
|
uses: actions/setup-node@v1
|
2021-02-14 21:37:12 +01:00
|
|
|
with:
|
|
|
|
node-version: '14'
|
2020-12-05 16:57:19 +01:00
|
|
|
- uses: dorny/paths-filter@v2
|
|
|
|
id: changes
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
docs:
|
|
|
|
- 'docs/**'
|
2021-02-15 21:25:10 +01:00
|
|
|
- 'package.json'
|
|
|
|
- 'tsconfig.json'
|
2020-12-19 18:52:18 +01:00
|
|
|
src:
|
|
|
|
- 'src/**'
|
2021-02-15 21:25:10 +01:00
|
|
|
- 'package.json'
|
2020-12-19 18:52:18 +01:00
|
|
|
test:
|
|
|
|
- 'test/**'
|
2021-02-01 13:50:18 +01:00
|
|
|
- 'karma.conf.js'
|
2021-02-15 21:25:10 +01:00
|
|
|
- 'package.json'
|
2020-12-19 18:52:18 +01:00
|
|
|
types:
|
|
|
|
- 'types/**'
|
2021-02-15 21:25:10 +01:00
|
|
|
- 'package.json'
|
|
|
|
- 'tsconfig.json'
|
2020-12-05 16:57:19 +01:00
|
|
|
- name: Install
|
|
|
|
run: npm ci
|
2020-12-19 18:52:18 +01:00
|
|
|
- name: Build
|
|
|
|
run: npm run build
|
|
|
|
- name: Test
|
|
|
|
if: |
|
|
|
|
steps.changes.outputs.src == 'true' ||
|
|
|
|
steps.changes.outputs.test == 'true'
|
2019-11-06 13:14:09 +01:00
|
|
|
run: |
|
2020-05-27 23:14:17 +02:00
|
|
|
npm run build
|
2020-11-17 04:02:34 +01:00
|
|
|
if [ "${{ runner.os }}" == "Windows" ]; then
|
|
|
|
npm test
|
|
|
|
elif [ "${{ runner.os }}" == "macOS" ]; then
|
|
|
|
npm test --browsers chrome,safari
|
|
|
|
else
|
|
|
|
xvfb-run --auto-servernum npm test
|
|
|
|
fi
|
|
|
|
shell: bash
|
2020-12-05 16:57:19 +01:00
|
|
|
- name: Lint
|
|
|
|
run: npm run lint
|
2019-11-06 13:14:09 +01:00
|
|
|
- name: Package
|
2020-12-05 16:57:19 +01:00
|
|
|
if: steps.changes.outputs.docs == 'true'
|
2019-11-06 13:14:09 +01:00
|
|
|
run: |
|
2020-05-05 21:19:57 +02:00
|
|
|
npm run docs
|
|
|
|
npm run typedoc
|
2020-05-27 23:14:17 +02:00
|
|
|
npm pack
|
2020-11-10 18:59:11 +01:00
|
|
|
- name: Coveralls Parallel - Chrome
|
2020-12-05 16:57:19 +01:00
|
|
|
if: steps.changes.outputs.src == 'true'
|
2020-11-10 16:21:38 +01:00
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
2020-11-10 18:59:11 +01:00
|
|
|
path-to-lcov: './coverage/chrome/lcov.info'
|
|
|
|
flag-name: ${{ matrix.os }}-chrome
|
|
|
|
parallel: true
|
|
|
|
- name: Coveralls Parallel - Firefox
|
2020-12-05 16:57:19 +01:00
|
|
|
if: steps.changes.outputs.src == 'true'
|
2020-11-10 18:59:11 +01:00
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
path-to-lcov: './coverage/firefox/lcov.info'
|
|
|
|
flag-name: ${{ matrix.os }}-firefox
|
2020-11-10 16:21:38 +01:00
|
|
|
parallel: true
|
|
|
|
|
|
|
|
|
|
|
|
finish:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Coveralls Finished
|
2020-12-05 16:57:19 +01:00
|
|
|
if: needs.build.outputs.coveralls == 'true'
|
2020-11-10 16:21:38 +01:00
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.github_token }}
|
|
|
|
parallel-finished: true
|