2019-09-16 01:27:57 +02:00
|
|
|
name: 'Test'
|
|
|
|
|
2019-09-22 02:37:17 +02:00
|
|
|
on:
|
|
|
|
push:
|
2019-10-01 13:10:45 +02:00
|
|
|
branches:
|
2020-07-17 08:38:09 +02:00
|
|
|
- main
|
2020-01-17 16:44:07 +01:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2019-09-16 01:27:57 +02:00
|
|
|
|
|
|
|
jobs:
|
2020-01-17 16:44:07 +01:00
|
|
|
test:
|
2019-09-21 03:41:21 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-09-16 01:27:57 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-01-17 16:44:07 +01:00
|
|
|
os:
|
2022-08-29 17:06:54 +02:00
|
|
|
- 'ubuntu-22.04'
|
2020-06-13 10:53:43 +02:00
|
|
|
- 'ubuntu-20.04'
|
2022-08-29 17:06:54 +02:00
|
|
|
- 'ubuntu-latest'
|
2020-01-17 16:44:07 +01:00
|
|
|
- 'macos-latest'
|
|
|
|
- 'windows-latest'
|
2019-09-16 01:27:57 +02:00
|
|
|
steps:
|
2022-03-02 03:40:05 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-01-17 16:44:07 +01:00
|
|
|
|
|
|
|
- name: Read .nvmrc
|
|
|
|
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
|
|
|
id: nvm
|
|
|
|
|
|
|
|
- name: Setup Node
|
2022-10-14 04:13:39 +02:00
|
|
|
uses: actions/setup-node@v3.5.1
|
2020-01-17 16:44:07 +01:00
|
|
|
with:
|
|
|
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
|
|
|
|
|
|
|
- run: npm ci
|
|
|
|
|
|
|
|
- name: Run prettier
|
2022-08-29 17:06:54 +02:00
|
|
|
if: startsWith(matrix.os, 'ubuntu-22.04')
|
2020-01-17 16:44:07 +01:00
|
|
|
run: npm run format:check
|
|
|
|
|
|
|
|
- name: Run eslint
|
2022-08-29 17:06:54 +02:00
|
|
|
if: startsWith(matrix.os, 'ubuntu-22.04')
|
2020-01-17 16:44:07 +01:00
|
|
|
run: npm run lint
|
|
|
|
|
|
|
|
- name: Run ncc
|
2022-08-29 17:06:54 +02:00
|
|
|
if: startsWith(matrix.os, 'ubuntu-22.04')
|
2020-01-17 16:44:07 +01:00
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
- run: npm test
|
|
|
|
|
|
|
|
- name: Upload test coverage as artifact
|
2022-04-11 14:36:56 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-01-17 16:44:07 +01:00
|
|
|
with:
|
2020-05-03 06:33:05 +02:00
|
|
|
name: coverage-${{ matrix.os }}
|
2020-01-17 16:44:07 +01:00
|
|
|
path: coverage
|
|
|
|
|
2022-04-06 14:38:22 +02:00
|
|
|
- uses: codecov/codecov-action@v3
|