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