-
-
Notifications
You must be signed in to change notification settings - Fork 1k
190 lines (190 loc) · 6.65 KB
/
validate.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: validate
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
should-build-docs: ${{ steps.filter.outputs.docs || steps.filter.outputs.workflow }}
should-build-ios: ${{ steps.filter.outputs.ios || steps.filter.outputs.workflow || steps.filter.outputs.js }}
should-build-android: ${{ steps.filter.outputs.android || steps.filter.outputs.workflow || steps.filter.outputs.js }}
should-check-types: ${{ steps.filter.outputs.js || steps.filter.outputs.workflow }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
workflow:
- '.github/workflows/validate.yml'
js:
- '.node-version'
- '.eslintrc.js'
- '.prettierrc.js'
- 'package.json'
- 'tsconfig.json'
- 'yarn.lock'
- 'src/**'
- 'example/src/**'
- 'example/**.json'
- 'example/**.js'
ios:
- 'ios/**'
- 'example/ios/**'
android:
- 'android/**'
- 'example/android/**'
docs:
- 'docs/**'
check-typescript:
runs-on: ubuntu-latest
needs: check-changes
steps:
- name: Checkout Repo
if: ${{ needs.check-changes.outputs.should-check-types }}
uses: actions/checkout@v4
- name: Setup Environment
uses: pkgxdev/setup@v2
with:
+: classic.yarnpkg.com
- name: Install Dependencies
if: ${{ needs.check-changes.outputs.should-check-types }}
run: |-
yarn install --frozen-lockfile
- name: Install Example Dependencies
if: ${{ needs.check-changes.outputs.should-check-types }}
run: |-
cd example
yarn install --frozen-lockfile
- name: Check Lint, Format & Types
if: ${{ needs.check-changes.outputs.should-check-types }}
run: |
yarn run ci:lint
yarn run ci:format
yarn run types
- name: Example - Check Lint, Format & Types
if: ${{ needs.check-changes.outputs.should-check-types }}
run: |
cd example
yarn run ci:lint
yarn run ci:format
yarn run types
build-ios:
runs-on: blaze/macos-14
needs: check-changes
steps:
- name: Checkout Repo
if: ${{ needs.check-changes.outputs.should-build-ios }}
uses: actions/checkout@v4
- name: Setup Environment
uses: pkgxdev/setup@v2
with:
classic.yarnpkg.com
tuist.io/xcbeautify
- name: Install Library Dependencies
if: ${{ needs.check-changes.outputs.should-build-ios }}
run: yarn install --frozen-lockfile
- name: Build Library
if: ${{ needs.check-changes.outputs.should-build-ios }}
run: yarn build
- name: Install Example Dependencies
if: ${{ needs.check-changes.outputs.should-build-ios }}
run: |-
cd example
yarn install --frozen-lockfile
- name: Bundle Install
if: ${{ needs.check-changes.outputs.should-build-ios }}
run: |-
cd example/ios
pkgx [email protected] gem install bundler
pkgx [email protected] bundle config set --local path 'vendor/bundle'
pkgx [email protected] bundle install
- name: Cache Cocoapods Dependencies
if: ${{ needs.check-changes.outputs.should-build-ios }}
uses: buildjet/cache@v4
with:
path: example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Cococapods
if: ${{ needs.check-changes.outputs.should-build-ios }}
run: |-
cd example/ios
pkgx [email protected] bundle exec pod install
- name: Build App
if: ${{ needs.check-changes.outputs.should-build-ios }}
run: |-
cd example/ios
set -o pipefail && xcodebuild build -workspace RNTPExample.xcworkspace -scheme RNTPExample -destination 'platform=iOS Simulator,name=iPhone 15 Pro' | xcbeautify --renderer github-actions
build-android:
runs-on: ubuntu-latest
needs: check-changes
steps:
- name: Checkout Repo
if: ${{ needs.check-changes.outputs.should-build-android }}
uses: actions/checkout@v4
- name: Setup Environment
uses: pkgxdev/setup@v2
with:
+: classic.yarnpkg.com
- name: Install Library Dependencies
if: ${{ needs.check-changes.outputs.should-build-android }}
run: yarn install --frozen-lockfile
- name: Build Library
if: ${{ needs.check-changes.outputs.should-build-android }}
run: yarn build
- name: Install Mobile Dependencies
if: ${{ needs.check-changes.outputs.should-build-android }}
run: |-
cd example
yarn install
- name: Cache Gradle Wrapper
if: ${{ needs.check-changes.outputs.should-build-android }}
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
if: ${{ needs.check-changes.outputs.should-build-android }}
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Build App
if: ${{ needs.check-changes.outputs.should-build-android }}
run: |-
cd example/android
./gradlew assembleDebug --no-daemon
build-docs:
runs-on: ubuntu-latest
needs: check-changes
defaults:
run:
working-directory: docs
steps:
- name: Checkout Repo
if: ${{ needs.check-changes.outputs.should-build-docs }}
uses: actions/checkout@v4
- name: Setup Environment
uses: pkgxdev/setup@v2
with:
+: classic.yarnpkg.com
- name: Install Dependencies
if: ${{ needs.check-changes.outputs.should-build-docs }}
run: |-
yarn install --frozen-lockfile
- name: Build Docs
if: ${{ needs.check-changes.outputs.should-build-docs }}
run: |-
yarn build