2020-11-25 10:27:21 +00:00
|
|
|
name: test
|
2020-11-25 10:18:52 +00:00
|
|
|
|
2022-02-24 20:39:53 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "*"
|
|
|
|
- "!master"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "*"
|
|
|
|
- "!master"
|
2020-11-25 10:18:52 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-03-21 19:06:16 +00:00
|
|
|
node-version: [14.x, 16.x, 18.x]
|
2020-11-25 10:18:52 +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: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2022-03-02 18:38:12 +00:00
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
|
2020-11-25 10:18:52 +00:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
|
|
${{ runner.os }}-build-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
2022-03-02 18:38:12 +00:00
|
|
|
- name: Install global dependencies
|
2023-03-21 18:49:33 +00:00
|
|
|
run: npm i yarn nyc coveralls -g
|
2022-03-02 18:38:12 +00:00
|
|
|
|
2020-11-25 10:18:52 +00:00
|
|
|
- name: Install dependencies
|
2022-03-02 18:38:12 +00:00
|
|
|
run: yarn
|
2020-11-25 10:18:52 +00:00
|
|
|
|
|
|
|
- name: Run linter
|
|
|
|
run: npm run lint
|
|
|
|
|
|
|
|
- name: Run test with coverage
|
|
|
|
run: npm run coverage
|
|
|
|
|
|
|
|
- name: Coveralls
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|