Skip to content

Commit 532e8a4

Browse files
authored
fix: fix #164 Build Failure on CI Due to CocoaPods 1.1.9 in iOS Project (#165)
* fix: fix #164 Build Failure on CI Due to CocoaPods 1.1.9 in iOS Project * ci: gh workflows for native ci * chore: update readme to set ci badge * ci: native gh action status check * chore: release 1.1.10
1 parent ea3671f commit 532e8a4

File tree

22 files changed

+641
-350
lines changed

22 files changed

+641
-350
lines changed

.github/workflows/build-apk.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Build Android APK
22

33
on:
4-
push:
5-
branches:
6-
- main
74
workflow_dispatch:
85

96
jobs:
@@ -29,7 +26,6 @@ jobs:
2926
- name: Setup Android SDK
3027
uses: android-actions/setup-android@v2
3128

32-
3329
- name: Install dependencies
3430
run: |
3531
npm install
@@ -42,12 +38,9 @@ jobs:
4238
cd example/android
4339
./gradlew assembleRelease
4440
mv app/build/outputs/apk/release/app-release.apk app-release-${{ github.sha }}.apk
45-
ls
46-
pwd
47-
echo ${{ github.workspace }}
4841
4942
- name: Upload APK
5043
uses: actions/upload-artifact@v3
5144
with:
5245
name: app-release-${{ github.sha }}.apk
53-
path: example/android/app-release-${{ github.sha }}.apk
46+
path: example/android/app-release-${{ github.sha }}.apk

.github/workflows/ci.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/native-ci.yml

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
name: Build and Test
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
paths:
6+
- 'example/**'
7+
- 'android/**'
8+
- 'ios/**'
9+
- 'src/**'
10+
- 'assets/**'
11+
- 'package.json'
12+
- 'react-native-image-marker.podspec'
13+
workflow_dispatch:
14+
15+
jobs:
16+
17+
install-dep:
18+
runs-on: macos-latest
19+
name: Install dependencies
20+
steps:
21+
- name: Checkout the code
22+
uses: actions/checkout@v4
23+
24+
- uses: actions/cache@v3
25+
name: Cache node_modules
26+
id: cache-node-modules
27+
with:
28+
path: |
29+
node_modules
30+
example/node_modules
31+
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}
32+
33+
- name: Set up Ruby
34+
uses: ruby/setup-ruby@v1
35+
with:
36+
ruby-version: 2.7
37+
bundler-cache: true
38+
- name: Setup node 16
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: '16'
42+
43+
- name: Install npm dependencies
44+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
45+
run: |
46+
ls
47+
pwd
48+
npm install
49+
cd example
50+
ls
51+
pwd
52+
npm install
53+
54+
android-build:
55+
runs-on: macos-latest
56+
name: Android Build
57+
needs: install-dep
58+
steps:
59+
- name: Checkout the code
60+
uses: actions/checkout@v4
61+
62+
- uses: actions/cache@v3
63+
name: Cache node_modules
64+
id: cache-node-modules
65+
with:
66+
path: |
67+
node_modules
68+
example/node_modules
69+
fail-on-cache-miss: true
70+
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}
71+
72+
- uses: actions/cache@v3
73+
id: cache-gradle
74+
name: Cache Gradle dependencies
75+
with:
76+
path: |
77+
~/.gradle/caches
78+
~/.gradle/wrapper
79+
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('android/src/**/*.kt') }}
80+
81+
- name: Set up Ruby
82+
uses: ruby/setup-ruby@v1
83+
with:
84+
ruby-version: 2.7
85+
bundler-cache: true
86+
87+
- name: Setup node 16
88+
uses: actions/setup-node@v3
89+
with:
90+
node-version: '16'
91+
92+
- name: Set up JDK
93+
uses: actions/setup-java@v3
94+
with:
95+
distribution: 'zulu'
96+
java-version: 11
97+
98+
- name: Install Gradle dependencies
99+
if: steps.cache-gradle.outputs.cache-hit != 'true'
100+
run: |
101+
cd example/android
102+
./gradlew build --stacktrace
103+
104+
- name: Run unit tests
105+
run: |
106+
cd example/android
107+
./gradlew test --stacktrace
108+
109+
- name: Build APK
110+
run: |
111+
npm run prepack
112+
cd example/android
113+
./gradlew assembleRelease
114+
mv app/build/outputs/apk/release/app-release.apk app-release-${{ github.sha }}.apk
115+
116+
- name: Upload APK
117+
uses: actions/upload-artifact@v3
118+
with:
119+
name: app-release-${{ github.sha }}.apk
120+
path: ${{ github.workspace }}/example/android/app-release-${{ github.sha }}.apk
121+
122+
android-test:
123+
runs-on: macos-latest
124+
needs: android-build
125+
name: Android Test
126+
strategy:
127+
matrix:
128+
api-level: [24, 25, 29, 30, 31]
129+
target: [default]
130+
steps:
131+
- name: Checkout the code
132+
uses: actions/checkout@v4
133+
134+
- uses: actions/cache@v3
135+
name: Cache node_modules
136+
id: cache-node-modules
137+
with:
138+
path: |
139+
node_modules
140+
example/node_modules
141+
fail-on-cache-miss: true
142+
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}
143+
144+
- uses: actions/cache@v3
145+
name: Cache Gradle dependencies
146+
id: cache-gradle
147+
with:
148+
path: |
149+
~/.gradle/caches
150+
~/.gradle/wrapper
151+
fail-on-cache-miss: true
152+
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('android/src/**/*.kt') }}
153+
154+
- name: Set up Ruby
155+
uses: ruby/setup-ruby@v1
156+
with:
157+
ruby-version: 2.7
158+
bundler-cache: true
159+
160+
- name: Setup node 16
161+
uses: actions/setup-node@v3
162+
with:
163+
node-version: '16'
164+
165+
- name: Set up JDK
166+
uses: actions/setup-java@v3
167+
with:
168+
distribution: 'zulu'
169+
java-version: 11
170+
171+
- name: Instrumentation Tests
172+
uses: reactivecircus/android-emulator-runner@v2
173+
with:
174+
api-level: ${{ matrix.api-level }}
175+
target: ${{ matrix.target }}
176+
arch: x86_64
177+
profile: Nexus 6
178+
script: |
179+
cd example/android && ./gradlew connectedCheck --stacktrace
180+
181+
- name: Upload Reports
182+
uses: actions/upload-artifact@v3
183+
with:
184+
name: Test-Reports
185+
path: ${{ github.workspace }}/example/android/app/build/reports
186+
if: always()
187+
188+
ios-build-test:
189+
runs-on: macos-latest
190+
needs: install-dep
191+
name: iOS Build and Test
192+
strategy:
193+
matrix:
194+
cocoapods: ['1.10.1', '1.11.0', '1.14.3']
195+
steps:
196+
- name: Checkout the code
197+
uses: actions/checkout@v4
198+
199+
- uses: actions/cache@v3
200+
name: Cache node_modules
201+
id: cache-node-modules
202+
with:
203+
path: |
204+
node_modules
205+
example/node_modules
206+
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}
207+
fail-on-cache-miss: true
208+
209+
- name: Cache Pods
210+
id: cache-pods
211+
uses: actions/cache@v3
212+
with:
213+
path: example/ios/Pods
214+
key: ${{ runner.os }}-pods-${{ matrix.cocoapods }}-${{ hashFiles('**/Podfile.lock') }}
215+
216+
- name: Set up Ruby
217+
uses: ruby/setup-ruby@v1
218+
with:
219+
ruby-version: 2.7
220+
bundler-cache: true
221+
- name: Install Cocoapods
222+
run: gem install cocoapods -v ${{ matrix.cocoapods }}
223+
- name: Setup node 16
224+
uses: actions/setup-node@v3
225+
with:
226+
node-version: '16'
227+
228+
- name: Install Pods
229+
if: steps.cache-pods.outputs.cache-hit != 'true'
230+
run: |
231+
cd example/ios
232+
pod cache clean --all
233+
pod install
234+
235+
- name: Install xcpretty
236+
run: gem install xcpretty
237+
238+
- name: Build
239+
run: |
240+
cd example/ios
241+
xcodebuild -workspace ImageMarkerExample.xcworkspace -scheme ImageMarkerExample -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' | xcpretty
242+
- name: Test
243+
run: |
244+
cd example/ios
245+
xcodebuild -workspace ImageMarkerExample.xcworkspace -scheme ImageMarkerExample -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' test | xcpretty
246+
247+
native-ci-complete:
248+
name: Complete CI
249+
needs: [android-build, android-test, ios-build-test]
250+
if: ${{ always() }}
251+
runs-on: ubuntu-latest
252+
steps:
253+
- name: Check all job status
254+
if: >-
255+
${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
256+
run: exit 1

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11

22

3+
## [1.1.10](https://github.com/JimmyDaddy/react-native-image-marker/compare/v1.1.8...v1.1.10) (2023-11-29)
4+
5+
6+
### Bug Fixes
7+
8+
* fix [#164](https://github.com/JimmyDaddy/react-native-image-marker/issues/164) Build Failure on CI Due to CocoaPods 1.1.9 in iOS Project ([d1758e5](https://github.com/JimmyDaddy/react-native-image-marker/commit/d1758e528befba9a9d125bad3c9c1b182865c1a5))
9+
310
## [1.1.9](https://github.com/JimmyDaddy/react-native-image-marker/compare/v1.1.8...v1.1.9) (2023-11-18)
411

512
### Bug Fixes
@@ -95,4 +102,4 @@
95102

96103
### Features
97104

98-
* support multiple text and more style options ([#104](https://github.com/JimmyDaddy/react-native-image-marker/issues/104)) ([0b91cd4](https://github.com/JimmyDaddy/react-native-image-marker/commit/0b91cd4baaf2f664f908483b225509e443f9bae7))
105+
* support multiple text and more style options ([#104](https://github.com/JimmyDaddy/react-native-image-marker/issues/104)) ([0b91cd4](https://github.com/JimmyDaddy/react-native-image-marker/commit/0b91cd4baaf2f664f908483b225509e443f9bae7))

README.MD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<div align="center">
99

1010
[![npm version](https://img.shields.io/npm/v/react-native-image-marker.svg?logo=npm)](https://www.npmjs.com/package/react-native-image-marker) [![npm](https://img.shields.io/npm/dm/react-native-image-marker?logo=npm)](https://www.npmjs.com/package/react-native-image-marker) [![stars](https://img.shields.io/github/stars/jimmydaddy/react-native-image-marker?style=social)](https://github.com/JimmyDaddy/react-native-image-marker) [![forks](https://img.shields.io/github/forks/jimmydaddy/react-native-image-marker?style=social)](https://github.com/JimmyDaddy/react-native-image-marker/fork)[![github](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/JimmyDaddy/react-native-image-marker) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?logo=github)](https://github.com/JimmyDaddy/react-native-image-marker/pulls) ![license](https://img.shields.io/npm/l/react-native-image-marker)
11-
![platform-iOS](https://img.shields.io/badge/iOS-black?logo=Apple) ![platform-Android](https://img.shields.io/badge/Android-black?logo=Android)
11+
![platform-iOS](https://img.shields.io/badge/iOS-black?logo=Apple) ![platform-Android](https://img.shields.io/badge/Android-black?logo=Android) [![Native Build and Test](https://github.com/JimmyDaddy/react-native-image-marker/actions/workflows/native-ci.yml/badge.svg)](https://github.com/JimmyDaddy/react-native-image-marker/actions/workflows/native-ci.yml)
12+
<br/>
1213
*If this library is useful to you, pls give me a ⭐️. 🤩*
1314
</div>
1415

android/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ dependencies {
7373
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.0"
7474
implementation "com.facebook.react:react-native:+"
7575
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
76+
testImplementation 'junit:junit:4.13.2'
77+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
78+
testImplementation "org.mockito:mockito-core:3.+"
7679
}
7780

7881
if (isNewArchitectureEnabled()) {

0 commit comments

Comments
 (0)