2022-05-10 17:26:08 -07:00
|
|
|
name: Unit Tests
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-10-10 20:13:50 +08:00
|
|
|
node-version: [18.x]
|
2022-05-10 17:26:08 -07:00
|
|
|
steps:
|
2022-09-05 01:00:47 +05:30
|
|
|
- uses: actions/checkout@v3
|
2022-05-10 17:26:08 -07:00
|
|
|
|
2022-09-25 19:24:40 +01:00
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
# uses version from "packageManager" field in package.json
|
|
|
|
|
2022-09-05 01:00:47 +05:30
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-09-25 19:24:40 +01:00
|
|
|
cache: pnpm
|
2022-09-05 01:00:47 +05:30
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-05-10 17:26:08 -07:00
|
|
|
|
2022-09-05 01:00:47 +05:30
|
|
|
- name: Install Packages
|
|
|
|
run: |
|
2022-09-25 19:24:40 +01:00
|
|
|
pnpm install --frozen-lockfile
|
2022-09-05 01:00:47 +05:30
|
|
|
env:
|
|
|
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
2022-05-10 17:26:08 -07:00
|
|
|
|
2022-09-05 01:00:47 +05:30
|
|
|
- name: Run Unit Tests
|
|
|
|
run: |
|
2022-09-25 19:24:40 +01:00
|
|
|
pnpm run ci --coverage
|
2022-09-08 03:51:42 +01:00
|
|
|
|
|
|
|
- name: Upload Coverage to Coveralls
|
|
|
|
# it feels a bit weird to use @master, but that's what the docs use
|
|
|
|
# (coveralls also doesn't publish a @v1 we can use)
|
|
|
|
# https://github.com/marketplace/actions/coveralls-github-action
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
flag-name: unit
|