2019-09-26 15:25:26 +02:00
|
|
|
name: JS Tests
|
2020-04-15 15:43:02 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- "**-ci"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "**"
|
|
|
|
|
2019-10-08 07:47:40 +02:00
|
|
|
env:
|
|
|
|
CI: true
|
2019-08-08 18:40:26 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
name: Node ${{ matrix.node }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
2019-08-24 01:32:29 +02:00
|
|
|
fail-fast: false
|
2019-08-08 18:40:26 +02:00
|
|
|
matrix:
|
2019-10-09 10:11:37 +02:00
|
|
|
node: [10, 12]
|
2019-08-08 18:40:26 +02:00
|
|
|
|
|
|
|
steps:
|
2019-08-24 01:32:29 +02:00
|
|
|
- name: Clone repository
|
2019-12-13 14:59:37 +01:00
|
|
|
uses: actions/checkout@v2
|
2019-08-09 17:28:41 +02:00
|
|
|
|
|
|
|
- name: Set Node.js version
|
2019-09-16 14:28:25 +02:00
|
|
|
uses: actions/setup-node@v1
|
2019-08-09 17:28:41 +02:00
|
|
|
with:
|
2019-09-16 14:28:25 +02:00
|
|
|
node-version: ${{ matrix.node }}
|
2019-08-09 17:28:41 +02:00
|
|
|
|
2019-12-13 16:12:03 +01:00
|
|
|
- name: Set up npm cache
|
2020-05-28 19:28:02 +02:00
|
|
|
uses: actions/cache@v2
|
2019-12-13 16:12:03 +01:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2020-05-28 19:28:02 +02:00
|
|
|
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}}
|
2019-12-13 16:12:03 +01:00
|
|
|
restore-keys: |
|
2020-05-28 19:28:02 +02:00
|
|
|
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
2019-12-24 17:12:13 +01:00
|
|
|
${{ runner.OS }}-node-v${{ matrix.node }}-
|
2019-12-13 16:12:03 +01:00
|
|
|
|
2019-08-09 17:28:41 +02:00
|
|
|
- name: Install npm dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
2019-09-26 15:25:26 +02:00
|
|
|
- name: Run dist
|
|
|
|
run: npm run js
|
2019-08-09 17:28:41 +02:00
|
|
|
|
2019-09-26 15:25:26 +02:00
|
|
|
- name: Run JS tests
|
|
|
|
run: npm run js-test
|
2019-08-09 17:28:41 +02:00
|
|
|
|
|
|
|
- name: Run Coveralls
|
2019-11-18 20:03:43 +01:00
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
if: matrix.node == 10
|
|
|
|
with:
|
|
|
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
path-to-lcov: "./js/coverage/lcov.info"
|