-
Notifications
You must be signed in to change notification settings - Fork 296
177 lines (137 loc) · 4.75 KB
/
ReactNativeSlider-CI.yml
File metadata and controls
177 lines (137 loc) · 4.75 KB
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
name: ReactNativeSlider-CI
on:
push:
branches:
- 'main'
- 'release/**'
pull_request:
types: [opened, reopened, synchronize]
jobs:
install:
name: Install dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache node modules
id: cache-package-npm
uses: actions/cache@v4
env:
cache-name: cached-ci-npm-deps
with:
path: ./package/node_modules
key: ${{ hashFiles('./package/package.json') }}
- name: Install required dependencies on cache miss (npm)
if: steps.cache-package-npm.outputs.cache-hit != 'true'
run: |
npm install
verify-package-sources:
name: Lint the sources
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Pull npm dependencies
uses: actions/cache@v4
with:
path: ./package/node_modules
key: ${{ hashFiles('./package/package.json') }}
- name: Run ESLint on the sources
run: cd package && npx eslint src
- name: Run TypeScript on the sources
run: cd package && npx tsc --noEmit
test:
name: Run the unit tests
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Pull npm dependencies
uses: actions/cache@v4
with:
path: ./package/node_modules
key: ${{ hashFiles('./package/package.json') }}
- name: Run unit tests
run: cd package && npx jest src
verify-example-sources:
name: Verify example app sources
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Run ESLint on the sources
run: cd example && npx eslint .
- name: Run TypeScript on the sources
run: cd example && npx tsc --noEmit
build-android-app-new-arch:
name: Build example app Android (Fabric)
runs-on: ubuntu-latest
needs: [verify-example-sources]
steps:
- uses: actions/checkout@v4
- name: Pull the npm dependencies
run: npm install
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Build the Android OS app
run: cd example/android && ./gradlew assembleDebug
build-iOS-new-arch-app:
name: Build example app iOS (Fabric)
runs-on: macos-latest
needs: [verify-example-sources]
steps:
- uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cached-ios-npm-deps
with:
path: example/node_modules
key: new-arch-${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}
- name: Install required dependencies on cache miss (npm)
if: steps.cache-npm.outputs.cache-hit != 'true'
run: |
npm install
- name: Cache Pods
id: cache-pods
uses: actions/cache@v4
env:
cache-name: cached-ios-pods-deps
with:
path: example/ios/Pods
key: new-arch-${{ hashFiles('./example/ios/Podfile.lock') }}
- name: Use the current package sources in build
run: cd example && npm run refresh-package
- name: Install required dependencies on cache miss (Pods)
if: steps.cache-pods.outputs.cache-hit != 'true'
run: |
cd example/ios && pod install
- name: Reinstall Pods only if using cached ones
if: steps.cache-pods.outputs.cache-hit == 'true'
run: cd example/ios && pod install
- name: Build iOS - Fabric
run: |
xcodebuild -workspace example.xcworkspace -scheme example -destination "platform=iOS Simulator" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO SKIP_BUNDLING=TRUE build | xcbeautify --renderer github-actions
working-directory: example/ios
build-Windows-app:
name: Build example app Windows
runs-on: windows-2022
needs: [verify-example-sources]
steps:
- name: Ensure the cross-platform Git on Windows
run: git config --global core.autocrlf false
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Restore NuGet packages
run: nuget restore .\example\windows\example.sln
- name: Build the Windows OS app
run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging --sln .\windows\example.sln --proj .\windows\example\example.vcxproj