2022-04-21 11:55:32 +00:00
|
|
|
name: Tests
|
2022-03-10 13:17:01 +00:00
|
|
|
on:
|
2022-04-21 11:55:32 +00:00
|
|
|
pull_request: { }
|
2022-03-10 13:17:01 +00:00
|
|
|
push:
|
2022-04-21 11:55:32 +00:00
|
|
|
branches: [ develop, master ]
|
|
|
|
repository_dispatch:
|
|
|
|
types: [ upstream-sdk-notify ]
|
2022-03-10 13:17:01 +00:00
|
|
|
jobs:
|
2022-04-21 11:55:32 +00:00
|
|
|
jest:
|
|
|
|
name: Jest with Codecov
|
2022-03-10 13:17:01 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-03-11 10:26:42 +00:00
|
|
|
env:
|
2022-03-11 13:00:56 +00:00
|
|
|
# This must be set for fetchdep.sh to get the right branch
|
2022-03-11 10:26:42 +00:00
|
|
|
PR_NUMBER: ${{github.event.number}}
|
2022-03-10 13:17:01 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2022-03-28 12:17:04 +00:00
|
|
|
with:
|
|
|
|
# If this is a pull request, make sure we check out its head rather than the
|
|
|
|
# automatically generated merge commit, so that the coverage diff excludes
|
|
|
|
# unrelated changes in the base branch
|
2022-03-30 12:02:34 +00:00
|
|
|
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
|
2022-03-10 13:17:01 +00:00
|
|
|
|
|
|
|
- name: Yarn cache
|
2022-04-21 11:55:32 +00:00
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
cache: 'yarn'
|
2022-03-10 13:17:01 +00:00
|
|
|
|
|
|
|
- name: Install Deps
|
|
|
|
run: "./scripts/ci/install-deps.sh --ignore-scripts"
|
|
|
|
|
|
|
|
- name: Run tests with coverage
|
2022-04-21 11:55:32 +00:00
|
|
|
run: "yarn coverage"
|
2022-03-10 13:17:01 +00:00
|
|
|
|
|
|
|
- name: Upload coverage
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
2022-03-14 11:01:02 +00:00
|
|
|
fail_ci_if_error: false
|
2022-03-10 13:17:01 +00:00
|
|
|
verbose: true
|
2022-04-13 00:22:34 +00:00
|
|
|
override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
|