57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
name: test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
- "!master"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
- "!master"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [14.x, 16.x, 18.x]
|
|
|
|
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
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
${{ runner.os }}-build-
|
|
${{ runner.os }}-
|
|
|
|
- name: Install global dependencies
|
|
run: npm i yarn nyc coveralls -g
|
|
|
|
- name: Install dependencies
|
|
run: yarn
|
|
|
|
- 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 }}
|