Skip to content

Commit c90d0ee

Browse files
chore: migrate CI to GH actions (core checks) (#1280)
1 parent 5f94d52 commit c90d0ee

File tree

4 files changed

+143
-1
lines changed

4 files changed

+143
-1
lines changed

.codecov.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ coverage:
22
precision: 2
33
round: down
44
range: 70...100
5+
comment:
6+
behavior: new
7+
require_changes: false
8+
require_base: no
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v3
9+
with:
10+
node-version: '16'
11+
12+
- name: Cache deps
13+
id: yarn-cache
14+
uses: actions/cache@v3
15+
with:
16+
path: ./node_modules
17+
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
18+
19+
- name: Install deps
20+
if: steps.yarn-cache.outputs.cache-hit != 'true'
21+
run: yarn install --frozen-lockfile
22+
shell: bash
23+
24+
- name: Cache website deps
25+
id: yarn-cache-website
26+
uses: actions/cache@v3
27+
with:
28+
path: ./website/node_modules
29+
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}-website
30+
31+
- name: Install website deps
32+
if: steps.yarn-cache-website.outputs.cache-hit != 'true'
33+
run: yarn --cwd website install --frozen-lockfile
34+
shell: bash

.github/workflows/main.yml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Main
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: ['**']
7+
8+
jobs:
9+
install-cached-deps:
10+
runs-on: ubuntu-latest
11+
name: Install and Cache deps
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Setup
17+
uses: ./.github/actions/setup-node-deps
18+
19+
lint:
20+
needs: [install-cached-deps]
21+
runs-on: ubuntu-latest
22+
name: Lint
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Setup Node.js and deps
28+
uses: ./.github/actions/setup-node-deps
29+
30+
- name: Lint
31+
run: yarn lint
32+
33+
typecheck:
34+
needs: [install-cached-deps]
35+
runs-on: ubuntu-latest
36+
name: Typecheck
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v3
40+
41+
- name: Setup Node.js and deps
42+
uses: ./.github/actions/setup-node-deps
43+
44+
- name: Typecheck
45+
run: yarn typecheck
46+
47+
flow:
48+
needs: [install-cached-deps]
49+
runs-on: ubuntu-latest
50+
name: Flow
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v3
54+
55+
- name: Setup Node.js and deps
56+
uses: ./.github/actions/setup-node-deps
57+
58+
- name: Flow
59+
run: yarn flow
60+
61+
test:
62+
needs: [install-cached-deps]
63+
runs-on: ubuntu-latest
64+
name: Test React 18
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v3
68+
69+
- name: Setup Node.js and deps
70+
uses: ./.github/actions/setup-node-deps
71+
72+
- name: Test React 18
73+
run: yarn test:ci
74+
75+
- name: Upload coverage to Codecov
76+
uses: codecov/codecov-action@v2
77+
78+
test-react-17:
79+
needs: [install-cached-deps]
80+
runs-on: ubuntu-latest
81+
name: Test React 17
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v3
85+
86+
- name: Setup Node.js and deps
87+
uses: ./.github/actions/setup-node-deps
88+
89+
- name: Test React 17
90+
run: yarn test:ci:react:17
91+
92+
test-website:
93+
needs: [install-cached-deps]
94+
runs-on: ubuntu-latest
95+
name: Test Website
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v3
99+
100+
- name: Setup Node.js and deps
101+
uses: ./.github/actions/setup-node-deps
102+
103+
- name: Build website
104+
run: yarn --cwd website build

scripts/test_react_17

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cp yarn.lock yarn.lock.backup
44
cp package.json package.json.backup
55

66
yarn add -D react@17.0.2 react-test-renderer@17.0.2 react-native@0.68.3 --ignore-scripts
7-
yarn test:ci
7+
yarn test:ci --collectCoverage=false
88

99
mv package.json.backup package.json
1010
mv yarn.lock.backup yarn.lock

0 commit comments

Comments
 (0)