-
Notifications
You must be signed in to change notification settings - Fork 636
74 lines (67 loc) · 2.01 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: facebook/metro/build-and-test
on:
push:
env:
node-version-min: 'v18.0.0'
node-version-lts: 'lts/*'
defaults:
run:
shell: bash
jobs:
run-js-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ env.node-version-lts }}
- 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@main
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ env.node-version-lts }}
- run: yarn test-coverage
- name: Download Codecov Uploader
run: "./.circleci/scripts/install_codecov.sh"
- name: Upload coverage results
run: "./codecov -t ${{ secrets.CODECOV_TOKEN }} -f ./coverage/coverage-final.json"
prepare-test:
runs-on: ubuntu-latest
outputs:
node-version-min: ${{ env.node-version-min }}
node-version-lts: ${{ env.node-version-lts }}
steps:
- run: echo "This is needed to allow 'matrix' to use these vars"
test:
runs-on: ubuntu-latest
needs: prepare-test
strategy:
matrix:
node-version: [
"${{ needs.prepare-test.outputs.node-version-lts }}",
"${{ needs.prepare-test.outputs.node-version-min }}"
]
steps:
- uses: actions/checkout@main
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ matrix.node-version }}
- name: Run Jest tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit
test-windows:
if: startsWith(github.ref, 'refs/heads/windows/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ env.node-version-lts }}
- name: Run Jest tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit
# todo: how max workers are best?