-
Notifications
You must be signed in to change notification settings - Fork 296
156 lines (122 loc) · 4.57 KB
/
ReactNativeSlider-CI.yml
File metadata and controls
156 lines (122 loc) · 4.57 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
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache node modules
id: cache-package-npm
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Pull npm dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Pull npm dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: ./package/node_modules
key: ${{ hashFiles('./package/package.json') }}
- name: Run unit tests
run: cd package && npx jest --coverage --verbose
verify-example-sources:
name: Verify example app sources
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache node modules
id: cache-npm
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
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@5a3ec84eff668545956fd18022155c47e93e2684
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