Skip to content

Commit d070f1a

Browse files
committedApr 19, 2021
chore: add basic quality assurance CI workflows
1 parent d91a2aa commit d070f1a

File tree

5 files changed

+307
-4
lines changed

5 files changed

+307
-4
lines changed
 

‎.github/workflows/linting.yml

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Code Quality Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
# linting:
13+
# name: ESLint
14+
# timeout-minutes: 15
15+
# runs-on: ubuntu-latest
16+
# steps:
17+
# - uses: styfle/cancel-workflow-action@0.9.0
18+
# with:
19+
# all_but_latest: true
20+
# - uses: actions/checkout@v2
21+
# with:
22+
# fetch-depth: 1
23+
# - uses: actions/setup-node@v2
24+
# with:
25+
# node-version: 14
26+
# - name: Get yarn cache directory path
27+
# id: yarn-cache-dir-path
28+
# run: echo "::set-output name=dir::$(yarn cache dir)"
29+
# - uses: actions/cache@v2
30+
# name: Yarn Cache
31+
# id: yarn-cache
32+
# with:
33+
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
34+
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
35+
# restore-keys: |
36+
# ${{ runner.os }}-yarn-
37+
# - name: Yarn Install
38+
# uses: nick-invision/retry@v2
39+
# with:
40+
# timeout_minutes: 3
41+
# retry_wait_seconds: 30
42+
# max_attempts: 3
43+
# command: yarn --no-audit --prefer-offline
44+
# - name: Lint
45+
# run: yarn lint
46+
# - name: Save Code Linting Report JSON
47+
# run: yarn lint:report
48+
# continue-on-error: true
49+
# - name: Annotate Code Linting Results
50+
# uses: ataylorme/eslint-annotate-action@1.1.2
51+
# continue-on-error: true
52+
# with:
53+
# repo-token: '${{ secrets.GITHUB_TOKEN }}'
54+
# report-json: 'eslint-report.json'
55+
# - name: Upload ESLint report
56+
# uses: actions/upload-artifact@v2
57+
# with:
58+
# name: eslint-report.json
59+
# path: eslint-report.json
60+
61+
typescript:
62+
name: TypeScript Build Validation
63+
runs-on: ubuntu-latest
64+
timeout-minutes: 15
65+
steps:
66+
- uses: styfle/cancel-workflow-action@0.9.0
67+
with:
68+
all_but_latest: true
69+
- uses: actions/checkout@v2
70+
with:
71+
fetch-depth: 1
72+
- uses: actions/setup-node@v2
73+
with:
74+
node-version: 14
75+
- name: Get yarn cache directory path
76+
id: yarn-cache-dir-path
77+
run: echo "::set-output name=dir::$(yarn cache dir)"
78+
- uses: actions/cache@v2
79+
name: Yarn Cache
80+
id: yarn-cache
81+
with:
82+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
83+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
84+
restore-keys: |
85+
${{ runner.os }}-yarn-
86+
- name: Yarn Install
87+
uses: nick-invision/retry@v2
88+
with:
89+
timeout_minutes: 3
90+
retry_wait_seconds: 30
91+
max_attempts: 3
92+
command: yarn --no-audit --prefer-offline
93+
- name: Lint
94+
run: yarn tsc:compile
95+
96+
# typedoc:
97+
# name: TypeDoc Generation
98+
# runs-on: ubuntu-latest
99+
# timeout-minutes: 15
100+
# steps:
101+
# - uses: styfle/cancel-workflow-action@0.9.0
102+
# with:
103+
# all_but_latest: true
104+
# - uses: actions/checkout@v2
105+
# with:
106+
# fetch-depth: 1
107+
# - uses: actions/setup-node@v2
108+
# with:
109+
# node-version: 14
110+
# - name: Get yarn cache directory path
111+
# id: yarn-cache-dir-path
112+
# run: echo "::set-output name=dir::$(yarn cache dir)"
113+
# - uses: actions/cache@v2
114+
# name: Yarn Cache
115+
# id: yarn-cache
116+
# with:
117+
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
118+
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-with-website
119+
# restore-keys: |
120+
# ${{ runner.os }}-yarn-
121+
# - name: Yarn Install
122+
# uses: nick-invision/retry@v2
123+
# with:
124+
# timeout_minutes: 3
125+
# retry_wait_seconds: 30
126+
# max_attempts: 3
127+
# command: yarn --no-audit --prefer-offline
128+
# - name: Yarn Install (Website)
129+
# uses: nick-invision/retry@v2
130+
# with:
131+
# timeout_minutes: 3
132+
# retry_wait_seconds: 30
133+
# max_attempts: 3
134+
# command: cd website && yarn --no-audit --prefer-offline
135+
# - name: Generate TypeDoc
136+
# run: node -e "require('./website/scripts/generate-typedoc').generateTypedoc()"

‎.github/workflows/pr_title.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'PR Title is Conventional'
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
9+
jobs:
10+
main:
11+
runs-on: ubuntu-latest
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v3.4.0
16+
with:
17+
validateSingleCommit: true

‎.github/workflows/tests_e2e.yml

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Testing E2E
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
paths-ignore:
8+
- 'docs/**'
9+
- '**/*.md'
10+
11+
push:
12+
branches:
13+
- master
14+
paths-ignore:
15+
- 'docs/**'
16+
- '**/*.md'
17+
18+
jobs:
19+
# ------------------
20+
# Android
21+
# ------------------
22+
android:
23+
name: Android
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 70
26+
steps:
27+
- uses: styfle/cancel-workflow-action@0.9.0
28+
with:
29+
all_but_latest: true
30+
31+
- uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 50
34+
35+
- uses: actions/setup-node@v2
36+
with:
37+
node-version: '14'
38+
- name: Get yarn cache directory path
39+
id: yarn-cache-dir-path
40+
run: echo "::set-output name=dir::$(yarn cache dir)"
41+
42+
- uses: actions/cache@v2
43+
name: Yarn Cache
44+
id: yarn-cache
45+
with:
46+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
47+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-v1
48+
49+
- uses: actions/cache@v2
50+
name: Gradle Cache
51+
with:
52+
path: ~/.gradle/caches
53+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-v1
54+
55+
- name: Yarn Install
56+
uses: nick-invision/retry@v2
57+
with:
58+
timeout_minutes: 10
59+
retry_wait_seconds: 60
60+
max_attempts: 3
61+
command: yarn --no-audit --prefer-offline
62+
63+
- name: Configure JDK 1.11
64+
uses: actions/setup-java@v2
65+
with:
66+
distribution: 'adopt'
67+
java-version: '11' # ubuntu-latest is about to default to 11, force it everywhere
68+
69+
- name: Verify JDK11
70+
# Default JDK varies depending on different runner flavors, make sure we are on 11
71+
# Run a check that exits with error unless it is 11 version to future-proof against unexpected upgrades
72+
run: java -fullversion 2>&1 | grep '11.0'
73+
shell: bash
74+
75+
- name: Build Android App
76+
uses: nick-invision/retry@v2
77+
with:
78+
timeout_minutes: 15
79+
retry_wait_seconds: 60
80+
max_attempts: 3
81+
command: yarn build:example:android
82+
83+
# ------------------
84+
# iOS
85+
# ------------------
86+
ios:
87+
name: iOS
88+
runs-on: macos-latest
89+
# TODO matrix across APIs, at least 10 and 13 (lowest to highest)
90+
timeout-minutes: 60
91+
steps:
92+
- uses: styfle/cancel-workflow-action@0.9.0
93+
with:
94+
all_but_latest: true
95+
96+
- uses: actions/checkout@v2
97+
with:
98+
fetch-depth: 50
99+
100+
- uses: actions/setup-node@v2
101+
with:
102+
node-version: 14
103+
104+
- uses: maxim-lobanov/setup-xcode@v1
105+
with:
106+
xcode-version: latest-stable
107+
108+
- name: Get Xcode version
109+
id: xcode-version
110+
run: echo "::set-output name=xcode-version::$(xcodebuild -version|tail -1|cut -f3 -d' ')"
111+
112+
- name: Get yarn cache directory path
113+
id: yarn-cache-dir-path
114+
run: echo "::set-output name=dir::$(yarn cache dir)"
115+
116+
- uses: actions/cache@v2
117+
name: Yarn Cache
118+
id: yarn-cache
119+
with:
120+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
121+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}-v1
122+
123+
- uses: actions/cache@v2
124+
name: Cache Pods
125+
with:
126+
path: example/ios/Pods
127+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}-v1
128+
129+
- name: Update Ruby build tools
130+
uses: nick-invision/retry@v2
131+
with:
132+
timeout_minutes: 10
133+
retry_wait_seconds: 60
134+
max_attempts: 3
135+
command: gem update cocoapods xcodeproj
136+
137+
- name: Yarn and Pod Install
138+
uses: nick-invision/retry@v2
139+
with:
140+
timeout_minutes: 10
141+
retry_wait_seconds: 60
142+
max_attempts: 3
143+
command: yarn --no-audit --prefer-offline
144+
145+
- name: Build iOS App
146+
run: |
147+
yarn build:example:ios
148+
shell: bash

‎example/ios/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ PODS:
219219
- React-cxxreact (= 0.61.5)
220220
- React-jsi (= 0.61.5)
221221
- ReactCommon/jscallinvoker (= 0.61.5)
222-
- RNAppleAuthentication (2.1.0):
222+
- RNAppleAuthentication (2.1.1):
223223
- React-Core
224224
- Yoga (1.14.0)
225225

@@ -342,7 +342,7 @@ SPEC CHECKSUMS:
342342
React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
343343
React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
344344
ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
345-
RNAppleAuthentication: 46cbc67739bae83ca229497f9b0038f3f5431443
345+
RNAppleAuthentication: f4cc93d710f1337f66550d04d84bf47553bc0eae
346346
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
347347

348348
PODFILE CHECKSUM: b1d11349ce6cf63de2878e6ee443202d7fc02a23

‎package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
"main": "lib/index.js",
77
"types": "lib/index.d.ts",
88
"scripts": {
9-
"analyze": "npx tsc --noEmit",
9+
"tsc:compile": "npx tsc --noEmit",
1010
"build": "genversion --semi lib/version.js",
1111
"build:all": "yarn build:clean && yarn build && yarn build:example:android && yarn build:example:ios",
1212
"build:example:android": "cd example/android && ./gradlew assembleDebug",
1313
"build:example:ios": "cd example && (xcodebuild -workspace ios/testing.xcworkspace -scheme testing -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES || true)",
1414
"build:clean": "rimraf ios/build android/build example/android/app/build example/ios/build",
1515
"build:docs": "typedoc --includeDeclarations --excludeExternals --out docs --plugin typedoc-plugin-markdown --hideBreadcrumbs",
16-
"prepare": "yarn analyze && yarn build && cd example && yarn && cd ios && (pod install || true)",
16+
"precommit": "yarn prepare && yarn build:all",
17+
"prepare": "yarn tsc:compile && yarn prepare:example",
18+
"prepare:example": "cd example && yarn && cd ios && (pod install || true)",
1719
"shipit": "yarn np"
1820
},
1921
"repository": {

0 commit comments

Comments
 (0)