Skip to content

Commit b8dab2c

Browse files
committed
ci: fix sonarcloud and daily android checks
1 parent b86f52c commit b8dab2c

File tree

5 files changed

+67
-6
lines changed

5 files changed

+67
-6
lines changed

.github/workflows/daily.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Daily"
2+
3+
on:
4+
5+
schedule:
6+
- cron: "0 0 * * *"
7+
8+
# Allow workflow to be manually run from the GitHub UI
9+
workflow_dispatch:
10+
11+
jobs:
12+
daily-job:
13+
name: "Daily Common Repo Checks"
14+
uses: mParticle/mparticle-workflows/.github/workflows/daily-cron.yml@main
15+
daily-local-job:
16+
name: "Daily Local Repo Checks"
17+
uses: mParticle/react-native-mparticle/.github/workflows/pull-request.yml@main
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Dependabot Automerge"
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build and Test"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
automerge-dependabot:
11+
name: "Automerge Dependabot PR"
12+
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-automerge.yml@main

.github/workflows/pull-request.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
workflow_call:
77
workflow_dispatch:
88

9-
# Run daily at midnight
10-
schedule:
11-
- cron: "0 0 * * *"
12-
139
jobs:
1410
js-tests:
1511
name: "JS Tests"
@@ -34,7 +30,26 @@ jobs:
3430
steps:
3531
- name: "Checkout"
3632
uses: actions/checkout@v3
37-
3833
- name: "Run Android Unit Tests"
3934
working-directory: android
40-
run: ./gradlew test
35+
run: ./gradlew test
36+
37+
android-lint:
38+
name: "Android Unit Tests"
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: "Checkout"
42+
uses: actions/checkout@v3
43+
- name: "Run Android Unit Tests"
44+
working-directory: android
45+
run: ./gradlew lint
46+
47+
android-kotlin-lint:
48+
name: "Android Unit Tests"
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: "Checkout"
52+
uses: actions/checkout@v3
53+
- name: "Run Android Unit Tests"
54+
working-directory: android
55+
run: ./gradlew ktlintCheck

.github/workflows/sonarcloud.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: "SonarCloud"
22

33
on:
4+
workflow_dispatch:
45
workflow_run:
56
workflows: ["Build and Test"]
67
types:
@@ -11,3 +12,5 @@ jobs:
1112
name: "SonarCloud Check"
1213
uses: mParticle/mparticle-workflows/.github/workflows/sonarcloud.yml@main
1314
secrets: inherit
15+
with:
16+
app_relative_path: "android"

android/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ buildscript {
88
}
99
}
1010

11+
plugins {
12+
id "org.sonarqube" version "3.5.0.2730"
13+
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
14+
}
15+
16+
sonarqube {
17+
properties {
18+
property "sonar.projectKey", "react-native-mparticle"
19+
property "sonar.organization", "mparticle"
20+
property "sonar.host.url", "https://sonarcloud.io"
21+
}
22+
}
23+
24+
apply plugin: 'org.jlleitschuh.gradle.ktlint'
1125
apply plugin: 'com.android.library'
1226

1327
android {

0 commit comments

Comments
 (0)