Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tests for android & ios #23

Merged
merged 42 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
54ea0eb
chore: initial test setup
mhochsto Aug 2, 2024
a36b677
chore: added test cases for web and Kotlin Crypto Module
mhochsto Aug 7, 2024
7cba9f1
chore: initial test setup
mhochsto Aug 2, 2024
a62e001
chore: added test cases for web and Kotlin Crypto Module
mhochsto Aug 7, 2024
8eb07d0
chore: fix linting, type errors
0x7061 Aug 8, 2024
4446c12
build: add test execution in workflows
axi92 Aug 9, 2024
1192749
chore: added crypto ios tests
mhochsto Aug 9, 2024
fa5323b
Merge branch 'feature/tests' of github.com:evva-sfw/abrevva-react-nat…
mhochsto Aug 9, 2024
0f41299
chore: added ble tests for swift
mhochsto Aug 9, 2024
26f7cf3
chore: added some testcases for android ble
mhochsto Aug 12, 2024
0ab52df
chore: update README
axi92 Aug 12, 2024
b8a5521
Update README.md
mhochsto Aug 13, 2024
b18baa4
chore: changed function names to non-backtick-names
mhochsto Aug 13, 2024
f5aa33d
Merge commit main into feature/tests
mhochsto Aug 13, 2024
e0c8495
chore: resolved issues from previous merge
mhochsto Aug 13, 2024
574d330
chore: added startNotification() testcase
mhochsto Aug 14, 2024
b050077
chore: README.md from main
mhochsto Aug 14, 2024
9848ff5
chore: merged latest changes from main
mhochsto Aug 14, 2024
abafe8c
Merge branch 'main' into feature/tests
axi92 Aug 19, 2024
45145b1
chore: update AbrevvaSDK version; add Makefile for ios test-command
0x7061 Aug 22, 2024
062d56c
chore: merge main into feature/test
0x7061 Aug 22, 2024
f116d43
ci: add ios test workflow
0x7061 Aug 22, 2024
a6a0934
ci: add quiet flag for ios test command
0x7061 Aug 22, 2024
22c8adb
ci: add ruby version & cache; add swift version & cache
0x7061 Aug 22, 2024
0e0910d
chore: bump deps
0x7061 Aug 22, 2024
cb2ff07
Merge branch 'main' into feature/tests
0x7061 Aug 22, 2024
ee6126f
chore: disable unsupported devices; remove xcode github workflow step
0x7061 Aug 22, 2024
bebc7d0
chore: adapt makefile and github ios workflow
0x7061 Aug 22, 2024
ec93e42
ci: display xcodebuild version
0x7061 Aug 23, 2024
7d713ff
ci: list xcode versions
0x7061 Aug 23, 2024
a667454
ci: set xcode version
0x7061 Aug 23, 2024
bf9cbe0
ci: use sudo due to xcode-select error
0x7061 Aug 23, 2024
af01f04
ci: show available software
0x7061 Aug 23, 2024
bfb769c
ci: print env.toolchains
0x7061 Aug 23, 2024
3141efd
ci: try developer_dir env var
0x7061 Aug 23, 2024
ae7d9ab
ci: set proper xcode version for test command
0x7061 Aug 23, 2024
014c9e6
chore: bump readme
0x7061 Aug 23, 2024
5a2b7bc
ci: add android test step
0x7061 Aug 23, 2024
c9f406d
ci: add exit 1 for all other exit types on android
0x7061 Aug 23, 2024
4385799
ci: add npm cache
0x7061 Aug 23, 2024
6006289
ci: streamline node_modules cache; add derived-data cache
0x7061 Aug 23, 2024
d0ac466
ci: add cache for pods
0x7061 Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_size = 4

[*.gradle]
indent_size = 4

Expand Down
79 changes: 78 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
branches: [ "main" ]
jobs:
test:
test-web:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -22,3 +22,80 @@ jobs:
cache: 'yarn'
- run: yarn
- run: yarn test

test-ios:
runs-on: macos-latest
strategy:
matrix:
node-version: [lts/*]
# See supported Node.js release schedule at https://nodejs.org/en/about/previous-releases
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: "Get Ruby Version"
run: ruby --version
- uses: SwiftyLab/setup-swift@latest
with:
swift-version: "5.10.0"
- name: Get Swift Version
run: swift --version
- name: Get Xcode version
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app
run: xcodebuild -version
- run: corepack enable
- run: yarn
- run: cd example; bundle; cd -
- run: cd example/ios; bundle exec pod install; cd -
- name: Run Tests
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app
run: make test-ios

test-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Cache NPM
id: cache-test-android-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}_cache-test-android-node-modules
- name: Cache Gradle
id: cache-test-android-gradle
uses: actions/cache@v4
with:
path: |
.gradle
example/android/.gradle
key: ${{ runner.os }}_cache-test-android-gradle
- run: |
corepack enable
yarn
- name: Run Gradle
if: steps.cache-gradle.outputs.cache-hit != 'true'
run: example/android/gradlew
- name: Run Tests
run: make test-android
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ example/vendor/
example/android/.idea/
example/android/local.properties
android/build
android/local.properties

# Exclude because this repo forces to use yarn instead of npm
package-lock.json
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test:
$(MAKE) test-ios
$(MAKE) test-android

test-ios:
xcodebuild -quiet \
-workspace example/ios/ExampleAppExample.xcworkspace \
-scheme ExampleAppExample \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' \
test || exit 1

test-android:
cd example/android && ./gradlew :evva-sfw_abrevva-react-native:testDebugUnitTest || exit 1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The EVVA React-Native Module is a collection of tools to work with electronical
- Java 17+ (Android)
- Android SDK (Android)
- Android 10+ (API level 29) (Android)
- Xcode 15+ (iOS)
- Xcode 15.4 (iOS)
- iOS 15.0+ (iOS)

## Installation
Expand Down
2 changes: 1 addition & 1 deletion abrevva-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Pod::Spec.new do |s|

s.dependency "CocoaMQTT"
s.dependency "CryptoSwift"
s.dependency "AbrevvaSDK", '~> 1.0.20'
s.dependency "AbrevvaSDK", '~> 1.0.23'

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
Expand Down
3 changes: 3 additions & 0 deletions android/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions android/.idea/android.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading