Skip to content

Unit Tests

Unit Tests #1787

Workflow file for this run

name: Unit Tests
on:
schedule:
- cron: '0 0 * * *'
push:
pull_request:
jobs:
default:
strategy:
matrix:
node: [16, 18]
os: [macos-latest, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Skip when run node.js@18 on ubuntu for compatibility reason
id: is_skip
if: matrix.os == 'ubuntu-22.04' && matrix.node == '18'
run: echo 'IS_SKIP=true' >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
- name: Setup Node
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Restore
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Deps
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
run: npm install
- name: Compile
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
run: npx lerna run tsc
- name: Test
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
run: yarn run test
- name: Upload codecov
if: matrix.os == 'macos-latest' && matrix.node == '18'
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true