Skip to content

Commit 1d23a5f

Browse files
authored
ci: Add in ktlintCheck to daily cron job (#284)
1 parent 416da3c commit 1d23a5f

10 files changed

Lines changed: 53 additions & 27 deletions

File tree

.github/workflows/daily.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
with:
8585
distribution: "zulu"
8686
java-version: "11"
87+
cache: "gradle"
8788
- name: "Run Instrumented Tests"
8889
uses: reactivecircus/android-emulator-runner@v2.26.0
8990
with:
@@ -112,6 +113,7 @@ jobs:
112113
with:
113114
distribution: "zulu"
114115
java-version: "11"
116+
cache: "gradle"
115117
- name: "Run Instrumented Orchestrator Tests"
116118
uses: reactivecircus/android-emulator-runner@v2.26.0
117119
with:
@@ -140,6 +142,7 @@ jobs:
140142
with:
141143
distribution: "zulu"
142144
java-version: "11"
145+
cache: "gradle"
143146
- name: "Run Unit Tests"
144147
run: ./gradlew test
145148
- name: "Print Android Unit Tests Report"
@@ -168,6 +171,7 @@ jobs:
168171
with:
169172
distribution: "zulu"
170173
java-version: "11"
174+
cache: "gradle"
171175
- name: "Run Android Core SDK Lint"
172176
run: ./gradlew lint
173177
- name: "Setup Android Kit Lint"
@@ -187,6 +191,42 @@ jobs:
187191
name: "kit-lint-results"
188192
path: kits/**/build/reports/**
189193

194+
kotlin-lint-checks:
195+
name: "Kotlin Lint Checks"
196+
timeout-minutes: 15
197+
runs-on: macos-latest
198+
needs: create-regression-branch
199+
steps:
200+
- name: "Checkout Branch"
201+
uses: actions/checkout@v3
202+
with:
203+
ref: regression/${{ github.run_number }}
204+
submodules: recursive
205+
- name: "Install JDK 11"
206+
uses: actions/setup-java@v3
207+
with:
208+
distribution: "zulu"
209+
java-version: "11"
210+
cache: "gradle"
211+
- name: "Run Android Core SDK Kotlin Lint"
212+
run: ./gradlew ktlintCheck
213+
- name: "Setup Android Kit Kotlin Lint"
214+
run: ./gradlew publishReleaseLocal
215+
- name: "Run Android Kit Kotlin Lint"
216+
run: ./gradlew publishReleaseLocal -c settings-kits.gradle ktlintCheck
217+
- name: "Archive Test Results"
218+
uses: actions/upload-artifact@v3
219+
if: always()
220+
with:
221+
name: "core-ktlint-results"
222+
path: ./**/build/reports/**
223+
- name: "Archive Test Kit Results"
224+
uses: actions/upload-artifact@v3
225+
if: always()
226+
with:
227+
name: "kit-ktlint-results"
228+
path: kits/**/build/reports/**
229+
190230
update-kits:
191231
name: "Update Kits"
192232
needs: create-regression-branch
@@ -208,6 +248,7 @@ jobs:
208248
with:
209249
distribution: "zulu"
210250
java-version: "11"
251+
cache: "gradle"
211252
- name: "Build Android Core"
212253
run: ./gradlew -PisRelease=true clean publishReleaseLocal
213254
- name: "Test Kits"

.github/workflows/pull-request.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,4 @@ jobs:
148148
automerge-dependabot:
149149
name: "Save PR Number for Dependabot Automerge"
150150
needs: [ instrumented-tests, instrumented-orchestrator-tests, unit-tests, lint-checks, kotlin-lint-checks, kit-compatibility-test ]
151-
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
152-
runs-on: ubuntu-latest
153-
steps:
154-
- name: "Checkout PR branch"
155-
uses: actions/checkout@v3
156-
with:
157-
submodules: recursive
158-
fetch-depth: 0
159-
- name: "Save Pull Request Number"
160-
run: |
161-
mkdir -p ./pr
162-
echo ${{ github.event.number }} > ./pr/NR
163-
- uses: actions/upload-artifact@v3
164-
with:
165-
name: pr
166-
path: pr/
151+
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
create-release-branch:
1818
name: "Create Release Branch"
19-
runs-on: ubuntu-18.04
19+
runs-on: ubuntu-latest
2020
needs: confirm-public-repo-main-branch
2121
env:
2222
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
@@ -117,7 +117,7 @@ jobs:
117117
sonatype-release:
118118
name: "Sonatype Release"
119119
needs: semantic-release
120-
runs-on: ubuntu-18.04
120+
runs-on: ubuntu-latest
121121
env:
122122
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
123123
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

android-core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ dependencies {
154154
androidTestImplementation project(':testutils')
155155
if (useOrchestrator()) {
156156
androidTestImplementation 'androidx.test:runner:1.4.0'
157-
androidTestUtil 'androidx.test:orchestrator:1.3.0'
157+
androidTestUtil 'androidx.test:orchestrator:1.4.2'
158158
}
159159
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
160160
androidTestImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"

android-kit-base/src/main/java/com/mparticle/kits/KitConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ public boolean shouldLogScreen(String screenName) {
569569
return true;
570570
}
571571

572-
573572
protected boolean shouldLogEvent(MPEvent event) {
574573
if (!shouldIncludeFromAttributeValueFiltering(event.getCustomAttributeStrings())) {
575574
return false;

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlin_version = '1.7.20'
2+
ext.kotlin_version = '1.7.21'
33
ext.gradle_version = '7.3.1'
44

55
repositories {

kit-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ apply from: '../scripts/maven.gradle'
99
dependencies {
1010
implementation gradleApi()
1111
implementation localGroovy()
12-
compileOnly "com.android.tools.build:gradle:7.3.0"
12+
compileOnly "com.android.tools.build:gradle:7.3.1"
1313
testImplementation "com.android.tools.build:gradle:4.1.3"
1414
}
1515

kit-plugin/src/main/groovy/com/mparticle/kits/KitPlugin.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package com.mparticle.kits
2+
23
import com.android.build.gradle.LibraryExtension
34
import org.gradle.api.Plugin
45
import org.gradle.api.Project

kit-plugin/src/test/groovy/com/mparticle/kits/KitPluginTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.junit.Test
66

77
class KitPluginTest {
88
@Test
9-
public void greeterPluginAddsGreetingTaskToProject() {
9+
void greeterPluginAddsGreetingTaskToProject() {
1010
Project project = ProjectBuilder.builder().build()
1111

1212
project.pluginManager.apply 'com.mparticle.kit'

testutils/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ dependencies {
5050
implementation fileTree(dir: 'libs', include: ['*.jar'])
5151
compileOnly project(':android-core')
5252
compileOnly project(':android-kit-base')
53-
compileOnly 'org.mockito:mockito-android:4.8.1'
53+
compileOnly 'org.mockito:mockito-android:4.9.0'
5454

5555
api 'androidx.annotation:annotation:1.5.0'
56-
api 'androidx.test.ext:junit:1.1.3'
56+
api 'androidx.test.ext:junit:1.1.4'
5757
api 'androidx.test:rules:1.4.0'
5858

5959
androidTestCompileOnly project(':android-core')
@@ -65,11 +65,11 @@ dependencies {
6565

6666
}
6767
androidTestImplementation 'androidx.test:runner:1.3.0'
68-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
68+
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
6969
androidTestImplementation 'androidx.test:rules:1.3.0'
7070
androidTestImplementation 'com.google.firebase:firebase-messaging:20.0.0'
7171

72-
androidTestUtil 'androidx.test:orchestrator:1.3.0'
72+
androidTestUtil 'androidx.test:orchestrator:1.4.2'
7373
}
7474

7575
boolean legacyTest() {

0 commit comments

Comments
 (0)