Skip to content

Commit

Permalink
fix: fix #164 Build Failure on CI Due to CocoaPods 1.1.9 in iOS Proje…
Browse files Browse the repository at this point in the history
…ct (#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
  • Loading branch information
JimmyDaddy committed Nov 29, 2023
1 parent ea3671f commit 532e8a4
Show file tree
Hide file tree
Showing 22 changed files with 641 additions and 350 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Build Android APK

on:
push:
branches:
- main
workflow_dispatch:

jobs:
Expand All @@ -29,7 +26,6 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v2


- name: Install dependencies
run: |
npm install
Expand All @@ -42,12 +38,9 @@ jobs:
cd example/android
./gradlew assembleRelease
mv app/build/outputs/apk/release/app-release.apk app-release-${{ github.sha }}.apk
ls
pwd
echo ${{ github.workspace }}
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app-release-${{ github.sha }}.apk
path: example/android/app-release-${{ github.sha }}.apk
path: example/android/app-release-${{ github.sha }}.apk
48 changes: 0 additions & 48 deletions .github/workflows/ci.yml

This file was deleted.

256 changes: 256 additions & 0 deletions .github/workflows/native-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
name: Build and Test
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'example/**'
- 'android/**'
- 'ios/**'
- 'src/**'
- 'assets/**'
- 'package.json'
- 'react-native-image-marker.podspec'
workflow_dispatch:

jobs:

install-dep:
runs-on: macos-latest
name: Install dependencies
steps:
- name: Checkout the code
uses: actions/checkout@v4

- uses: actions/cache@v3
name: Cache node_modules
id: cache-node-modules
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install npm dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
ls
pwd
npm install
cd example
ls
pwd
npm install
android-build:
runs-on: macos-latest
name: Android Build
needs: install-dep
steps:
- name: Checkout the code
uses: actions/checkout@v4

- uses: actions/cache@v3
name: Cache node_modules
id: cache-node-modules
with:
path: |
node_modules
example/node_modules
fail-on-cache-miss: true
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}

- uses: actions/cache@v3
id: cache-gradle
name: Cache Gradle dependencies
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('android/src/**/*.kt') }}

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true

- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Install Gradle dependencies
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: |
cd example/android
./gradlew build --stacktrace
- name: Run unit tests
run: |
cd example/android
./gradlew test --stacktrace
- name: Build APK
run: |
npm run prepack
cd example/android
./gradlew assembleRelease
mv app/build/outputs/apk/release/app-release.apk app-release-${{ github.sha }}.apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app-release-${{ github.sha }}.apk
path: ${{ github.workspace }}/example/android/app-release-${{ github.sha }}.apk

android-test:
runs-on: macos-latest
needs: android-build
name: Android Test
strategy:
matrix:
api-level: [24, 25, 29, 30, 31]
target: [default]
steps:
- name: Checkout the code
uses: actions/checkout@v4

- uses: actions/cache@v3
name: Cache node_modules
id: cache-node-modules
with:
path: |
node_modules
example/node_modules
fail-on-cache-miss: true
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}

- uses: actions/cache@v3
name: Cache Gradle dependencies
id: cache-gradle
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
fail-on-cache-miss: true
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('android/src/**/*.kt') }}

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true

- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: Nexus 6
script: |
cd example/android && ./gradlew connectedCheck --stacktrace
- name: Upload Reports
uses: actions/upload-artifact@v3
with:
name: Test-Reports
path: ${{ github.workspace }}/example/android/app/build/reports
if: always()

ios-build-test:
runs-on: macos-latest
needs: install-dep
name: iOS Build and Test
strategy:
matrix:
cocoapods: ['1.10.1', '1.11.0', '1.14.3']
steps:
- name: Checkout the code
uses: actions/checkout@v4

- uses: actions/cache@v3
name: Cache node_modules
id: cache-node-modules
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }}
fail-on-cache-miss: true

- name: Cache Pods
id: cache-pods
uses: actions/cache@v3
with:
path: example/ios/Pods
key: ${{ runner.os }}-pods-${{ matrix.cocoapods }}-${{ hashFiles('**/Podfile.lock') }}

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Install Cocoapods
run: gem install cocoapods -v ${{ matrix.cocoapods }}
- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install Pods
if: steps.cache-pods.outputs.cache-hit != 'true'
run: |
cd example/ios
pod cache clean --all
pod install
- name: Install xcpretty
run: gem install xcpretty

- name: Build
run: |
cd example/ios
xcodebuild -workspace ImageMarkerExample.xcworkspace -scheme ImageMarkerExample -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' | xcpretty
- name: Test
run: |
cd example/ios
xcodebuild -workspace ImageMarkerExample.xcworkspace -scheme ImageMarkerExample -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' test | xcpretty
native-ci-complete:
name: Complete CI
needs: [android-build, android-test, ios-build-test]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check all job status
if: >-
${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
run: exit 1
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@


## [1.1.10](https://github.com/JimmyDaddy/react-native-image-marker/compare/v1.1.8...v1.1.10) (2023-11-29)


### Bug Fixes

* 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))

## [1.1.9](https://github.com/JimmyDaddy/react-native-image-marker/compare/v1.1.8...v1.1.9) (2023-11-18)

### Bug Fixes
Expand Down Expand Up @@ -95,4 +102,4 @@

### Features

* 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))
* 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))
3 changes: 2 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<div align="center">

[![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)
![platform-iOS](https://img.shields.io/badge/iOS-black?logo=Apple) ![platform-Android](https://img.shields.io/badge/Android-black?logo=Android)
![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)
<br/>
*If this library is useful to you, pls give me a ⭐️. 🤩*
</div>

Expand Down
3 changes: 3 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.0"
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation "org.mockito:mockito-core:3.+"
}

if (isNewArchitectureEnabled()) {
Expand Down

0 comments on commit 532e8a4

Please sign in to comment.