-
Notifications
You must be signed in to change notification settings - Fork 634
52 lines (47 loc) · 1.51 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: facebook/metro/build-and-test
on:
workflow_call:
pull_request:
types: [opened, synchronize]
# head_ref is per PR, so this ensures that updaing the latest PR commit
# will cancel the previous run of the workflow and trigger a new one
concurrency:
group: "build-and-test-${{ github.head_ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
run-js-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
- run: yarn typecheck
- run: yarn typecheck-ts
- run: yarn lint
- run: yarn test-smoke
test-with-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
- run: yarn test-coverage
- name: Download Codecov Uploader
run: "./.github/scripts/install_codecov.sh"
- name: Upload coverage results
run: "./codecov -t ${{ secrets.CODECOV_TOKEN }} -f ./coverage/coverage-final.json"
test:
strategy:
matrix:
runs-on: ['ubuntu-latest'] # 'windows-latest'
node-version-type: ['lts', 'min-supported']
name: "Tests on ${{ matrix.runs-on }} using ${{ matrix.node-version-type }} node"
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
with:
node-version-type: ${{ matrix.node-version-type }}
- name: Run Jest tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'