Skip to content

Commit

Permalink
ci: Add in ktlintCheck to daily cron job (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchuangatmp authored Nov 28, 2022
1 parent 416da3c commit 1d23a5f
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 27 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Instrumented Tests"
uses: reactivecircus/android-emulator-runner@v2.26.0
with:
Expand Down Expand Up @@ -112,6 +113,7 @@ jobs:
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Instrumented Orchestrator Tests"
uses: reactivecircus/android-emulator-runner@v2.26.0
with:
Expand Down Expand Up @@ -140,6 +142,7 @@ jobs:
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Unit Tests"
run: ./gradlew test
- name: "Print Android Unit Tests Report"
Expand Down Expand Up @@ -168,6 +171,7 @@ jobs:
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Android Core SDK Lint"
run: ./gradlew lint
- name: "Setup Android Kit Lint"
Expand All @@ -187,6 +191,42 @@ jobs:
name: "kit-lint-results"
path: kits/**/build/reports/**

kotlin-lint-checks:
name: "Kotlin Lint Checks"
timeout-minutes: 15
runs-on: macos-latest
needs: create-regression-branch
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
with:
ref: regression/${{ github.run_number }}
submodules: recursive
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Android Core SDK Kotlin Lint"
run: ./gradlew ktlintCheck
- name: "Setup Android Kit Kotlin Lint"
run: ./gradlew publishReleaseLocal
- name: "Run Android Kit Kotlin Lint"
run: ./gradlew publishReleaseLocal -c settings-kits.gradle ktlintCheck
- name: "Archive Test Results"
uses: actions/upload-artifact@v3
if: always()
with:
name: "core-ktlint-results"
path: ./**/build/reports/**
- name: "Archive Test Kit Results"
uses: actions/upload-artifact@v3
if: always()
with:
name: "kit-ktlint-results"
path: kits/**/build/reports/**

update-kits:
name: "Update Kits"
needs: create-regression-branch
Expand All @@ -208,6 +248,7 @@ jobs:
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Build Android Core"
run: ./gradlew -PisRelease=true clean publishReleaseLocal
- name: "Test Kits"
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,4 @@ jobs:
automerge-dependabot:
name: "Save PR Number for Dependabot Automerge"
needs: [ instrumented-tests, instrumented-orchestrator-tests, unit-tests, lint-checks, kotlin-lint-checks, kit-compatibility-test ]
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: "Checkout PR branch"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: "Save Pull Request Number"
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v3
with:
name: pr
path: pr/
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

create-release-branch:
name: "Create Release Branch"
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: confirm-public-repo-main-branch
env:
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
sonatype-release:
name: "Sonatype Release"
needs: semantic-release
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion android-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ dependencies {
androidTestImplementation project(':testutils')
if (useOrchestrator()) {
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestUtil 'androidx.test:orchestrator:1.3.0'
androidTestUtil 'androidx.test:orchestrator:1.4.2'
}
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
androidTestImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ public boolean shouldLogScreen(String screenName) {
return true;
}


protected boolean shouldLogEvent(MPEvent event) {
if (!shouldIncludeFromAttributeValueFiltering(event.getCustomAttributeStrings())) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.20'
ext.kotlin_version = '1.7.21'
ext.gradle_version = '7.3.1'

repositories {
Expand Down
2 changes: 1 addition & 1 deletion kit-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply from: '../scripts/maven.gradle'
dependencies {
implementation gradleApi()
implementation localGroovy()
compileOnly "com.android.tools.build:gradle:7.3.0"
compileOnly "com.android.tools.build:gradle:7.3.1"
testImplementation "com.android.tools.build:gradle:4.1.3"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.mparticle.kits

import com.android.build.gradle.LibraryExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.junit.Test

class KitPluginTest {
@Test
public void greeterPluginAddsGreetingTaskToProject() {
void greeterPluginAddsGreetingTaskToProject() {
Project project = ProjectBuilder.builder().build()

project.pluginManager.apply 'com.mparticle.kit'
Expand Down
8 changes: 4 additions & 4 deletions testutils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly project(':android-core')
compileOnly project(':android-kit-base')
compileOnly 'org.mockito:mockito-android:4.8.1'
compileOnly 'org.mockito:mockito-android:4.9.0'

api 'androidx.annotation:annotation:1.5.0'
api 'androidx.test.ext:junit:1.1.3'
api 'androidx.test.ext:junit:1.1.4'
api 'androidx.test:rules:1.4.0'

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

}
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'com.google.firebase:firebase-messaging:20.0.0'

androidTestUtil 'androidx.test:orchestrator:1.3.0'
androidTestUtil 'androidx.test:orchestrator:1.4.2'
}

boolean legacyTest() {
Expand Down

0 comments on commit 1d23a5f

Please sign in to comment.