Skip to content

Commit b86f52c

Browse files
authored
ci: Updated .yml files, gradle dependencies and function signature. (#85)
1 parent 1a4e56f commit b86f52c

File tree

81 files changed

+1266
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1266
-65
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gradle
4+
directory: "/android"
5+
schedule:
6+
interval: daily
7+
labels: ["dependabot"]
8+
open-pull-requests-limit: 10
9+
ignore:
10+
- dependency-name: "com.google.firebase:firebase-messaging"
11+
commit-message:
12+
prefix: "chore"

.github/workflows/pull-request.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
name: "Build and Test"
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
push:
6+
workflow_call:
7+
workflow_dispatch:
8+
9+
# Run daily at midnight
10+
schedule:
11+
- cron: "0 0 * * *"
412

513
jobs:
614
js-tests:
715
name: "JS Tests"
816
runs-on: macOS-latest
917
steps:
1018
- name: "Checkout"
11-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
1220
- uses: actions/setup-node@master
13-
- uses: c-hive/gha-yarn-cache@v1
21+
- uses: c-hive/gha-yarn-cache@v2
1422

1523
- name: "Install node modules"
1624
run: |
@@ -19,12 +27,13 @@ jobs:
1927
- name: "Run test"
2028
run: |
2129
yarn test
30+
2231
android-unit-tests:
2332
name: "Android Unit Tests"
24-
runs-on: ubuntu-18.04
33+
runs-on: ubuntu-latest
2534
steps:
2635
- name: "Checkout"
27-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
2837

2938
- name: "Run Android Unit Tests"
3039
working-directory: android

.github/workflows/release.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,26 @@ name: Release SDK
22

33
on:
44
workflow_dispatch
5+
56
jobs:
67
# SDK release is done from public/master branch.
78
confirm-master-branch:
89
name: Confirm release is run on public/master branch
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Git checkout
12-
uses: actions/checkout@v1
13-
- name: Branch name
14-
run: |
15-
BRANCHNAME=${GITHUB_REF##*/}
16-
echo "pulling branch name, branch name is:"
17-
echo $BRANCHNAME
18-
if [ $BRANCHNAME != "master" ]
19-
then
20-
echo "You can only run a release from the master branch, you are trying to run it from ${BRANCHNAME}"
21-
exit 1
22-
fi
10+
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@main
2311

2412
# All new code is stored in internal/development. Release from public/master will merge changes from internal/development into
2513
# public/master, then run semantic-release on public/master to update changelog and release notes. Before semantic-release publishes
2614
# to npm, it builds the dist/ folder. Finally, commits from public/master are synced back to internal/master and internal/development.
2715

2816
react-tests:
2917
name: Run React Native Unit Tests
30-
runs-on: ubuntu-18.04
18+
runs-on: ubuntu-latest
3119
needs: ['confirm-master-branch']
3220
steps:
3321
- name: Checkout
34-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
3523
- uses: actions/setup-node@master
36-
- uses: c-hive/gha-yarn-cache@v1
24+
- uses: c-hive/gha-yarn-cache@v2
3725

3826
- name: Install node modules
3927
run: yarn install
@@ -43,26 +31,25 @@ jobs:
4331

4432
android-unit-tests:
4533
name: Run Android Unit Tests
46-
runs-on: ubuntu-18.04
34+
runs-on: ubuntu-latest
4735
needs: ['confirm-master-branch']
4836
steps:
4937
- name: Checkout
50-
uses: actions/checkout@v2
38+
uses: actions/checkout@v3
5139

5240
- name: Run Android Unit Tests
5341
run: echo "pwd"; pwd; echo "ls:"; ls; cd android; ./gradlew test
5442

55-
5643
release-and-sync-repos:
5744
name: Release and Sync Repos
58-
runs-on: ubuntu-18.04
45+
runs-on: ubuntu-latest
5946
needs: ['android-unit-tests', 'react-tests']
6047
steps:
6148
- name: Checkout internal/development
62-
uses: actions/checkout@v2
49+
uses: actions/checkout@v3
6350

6451
- name: Setup Node.js
65-
uses: actions/setup-node@v1
52+
uses: actions/setup-node@v3
6653
with:
6754
node-version: 12.x
6855

.github/workflows/sonarcloud.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "SonarCloud"
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build and Test"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
sonarcloud-check:
11+
name: "SonarCloud Check"
12+
uses: mParticle/mparticle-workflows/.github/workflows/sonarcloud.yml@main
13+
secrets: inherit

android/build.gradle

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
google()
5+
}
6+
dependencies {
7+
classpath 'com.android.tools.build:gradle:7.3.1'
8+
}
9+
}
10+
111
apply plugin: 'com.android.library'
212

313
android {
4-
compileSdkVersion 28
5-
buildToolsVersion "28.0.3"
14+
compileSdkVersion 33
615

716
defaultConfig {
8-
minSdkVersion 16
9-
targetSdkVersion 28
10-
versionCode 1
11-
versionName "1.0"
17+
minSdkVersion 21
18+
targetSdkVersion 33
19+
versionCode 2
20+
versionName "2.0.0"
1221
}
1322
buildTypes {
1423
release {
@@ -21,24 +30,18 @@ android {
2130
}
2231
}
2332

24-
25-
buildscript {
26-
repositories {
27-
mavenCentral()
28-
google()
29-
}
30-
dependencies {
31-
classpath 'com.android.tools.build:gradle:3.5.1'
32-
}
33-
}
34-
3533
repositories {
34+
maven {
35+
//update periodically - current version: 0.70.5
36+
url "$rootDir/react-native-android"
37+
}
3638
mavenCentral()
3739
google()
40+
3841
}
3942

4043
dependencies {
41-
compileOnly 'com.facebook.react:react-native:+'
44+
compileOnly 'com.facebook.react:react-native:0.20.1'
4245

4346
//
4447
// In your app, you should include mParticle core like this:
@@ -55,12 +58,13 @@ dependencies {
5558
// compile 'com.mparticle:android-example-kit:REPLACEME'
5659
//
5760

58-
testImplementation 'org.mockito:mockito-android:2.18.3'
59-
testImplementation 'com.android.support:support-annotations:27.1.1'
60-
testImplementation 'junit:junit:4.12'
61-
testImplementation files('libs/java-json.jar')
61+
testImplementation 'org.mockito:mockito-core:4.9.0'
62+
androidTestImplementation 'org.mockito:mockito-android:4.9.0'
63+
testImplementation 'androidx.annotation:annotation:1.5.0'
6264

63-
testImplementation 'com.mparticle:android-core:5+'
64-
testImplementation 'com.facebook.react:react-native:+'
65+
testImplementation 'junit:junit:4.13.2'
66+
testImplementation files('libs/java-json.jar')
6567

68+
testImplementation 'com.mparticle:android-core:5.48.3'
69+
testImplementation 'com.facebook.react:react-native:0.20.1'
6670
}

android/gradle.properties

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13+
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true
19+
20+
# AndroidX package structure to make it clearer which packages are bundled with the
21+
# Android operating system, and which are packaged with your app's APK
22+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
23+
android.useAndroidX=true
24+
25+
# Automatically convert third-party libraries to use AndroidX
26+
android.enableJetifier=true
27+
28+
# Version of flipper SDK to use with React Native
29+
FLIPPER_VERSION=0.125.0
30+
31+
# Use this property to specify which architecture you want to build.
32+
# You can also override it from the CLI using
33+
# ./gradlew <task> -PreactNativeArchitectures=x86_64
34+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
35+
36+
# Use this property to enable support to the new architecture.
37+
# This will allow you to use TurboModules and the Fabric render in
38+
# your application. You should enable this flag either if you want
39+
# to write custom TurboModules/Fabric components OR use libraries that
40+
# are providing them.
41+
newArchEnabled=false
42+
43+
# The hosted JavaScript engine
44+
# Supported values: expo.jsEngine = "hermes" | "jsc"
45+
expo.jsEngine=jsc
46+
47+
# Enable GIF support in React Native images (~200 B increase)
48+
expo.gif.enabled=true
49+
# Enable webp support in React Native images (~85 KB increase)
50+
expo.webp.enabled=true
51+
# Enable animated webp support (~3.4 MB increase)
52+
# Disabled by default because iOS doesn't support animated webp
53+
expo.webp.animated=false

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7b864274b543d21ee7d7c9c8e7f7b043
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
75340c383a5d55a37d68181f12b1d8d939a3f065

0 commit comments

Comments
 (0)