Skip to content

Commit

Permalink
Update fork (#1)
Browse files Browse the repository at this point in the history
* Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump actions/upload-artifact from 3.1.2 to 3.1.3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump org.json:json from 20230227 to 20230618

Bumps [org.json:json](https://github.com/douglascrockford/JSON-java) from 20230227 to 20230618.
- [Release notes](https://github.com/douglascrockford/JSON-java/releases)
- [Changelog](https://github.com/stleary/JSON-java/blob/master/docs/RELEASES.md)
- [Commits](https://github.com/douglascrockford/JSON-java/commits)

---
updated-dependencies:
- dependency-name: org.json:json
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Reduce CI complexity

* Fix compileSdk deprecation

* Build with java 17

* Introduce Kotlin

* Remove jacoco

* Fix publish

* Bump org.robolectric:robolectric from 4.9.2 to 4.10.3

Bumps [org.robolectric:robolectric](https://github.com/robolectric/robolectric) from 4.9.2 to 4.10.3.
- [Release notes](https://github.com/robolectric/robolectric/releases)
- [Commits](robolectric/robolectric@robolectric-4.9.2...robolectric-4.10.3)

---
updated-dependencies:
- dependency-name: org.robolectric:robolectric
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Introduce Espresso tests

It's a pre task for Strict violations oberservations

* Improve logging

* Keep more Espresso output

* Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.0 to 1.9.10

Bumps [org.jetbrains.kotlin:kotlin-gradle-plugin](https://github.com/JetBrains/kotlin) from 1.9.0 to 1.9.10.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.10/ChangeLog.md)
- [Commits](JetBrains/kotlin@v1.9.0...v1.9.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Keep more Espresso output

* Android Studio Giraffe

* Switch to plugins

* Revert "Remove jacoco"

This reverts commit a02f946.

* Run without daemon

gradle/gradle#17229 (comment)

* Using different plugin

arturdm/jacoco-android-gradle-plugin#102 (comment)

* First Kotlin conversion

* Test api30

* Make some screenshots

* Android Giraffe

* Bump com.mxalbert.gradle:jacoco-android from 0.2.1-SNAPSHOT to 0.2.1

Bumps [com.mxalbert.gradle:jacoco-android](https://github.com/mxalbert1996/jacoco-android-gradle-plugin) from 0.2.1-SNAPSHOT to 0.2.1.
- [Release notes](https://github.com/mxalbert1996/jacoco-android-gradle-plugin/releases)
- [Commits](https://github.com/mxalbert1996/jacoco-android-gradle-plugin/commits/0.2.1)

---
updated-dependencies:
- dependency-name: com.mxalbert.gradle:jacoco-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Cleanup

* Bump com.android.tools.build:gradle from 8.1.1 to 8.1.2

Bumps com.android.tools.build:gradle from 8.1.1 to 8.1.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump org.mockito:mockito-core from 5.5.0 to 5.6.0

Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.5.0 to 5.6.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v5.5.0...v5.6.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump org.json:json from 20230618 to 20231013

Bumps [org.json:json](https://github.com/douglascrockford/JSON-java) from 20230618 to 20231013.
- [Release notes](https://github.com/douglascrockford/JSON-java/releases)
- [Changelog](https://github.com/stleary/JSON-java/blob/master/docs/RELEASES.md)
- [Commits](https://github.com/douglascrockford/JSON-java/commits)

---
updated-dependencies:
- dependency-name: org.json:json
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump com.squareup.okhttp3:mockwebserver from 4.11.0 to 4.12.0

Bumps [com.squareup.okhttp3:mockwebserver](https://github.com/square/okhttp) from 4.11.0 to 4.12.0.
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](square/okhttp@parent-4.11.0...parent-4.12.0)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:mockwebserver
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hannes Achleitner <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2023
1 parent 4755d45 commit f37643b
Show file tree
Hide file tree
Showing 19 changed files with 428 additions and 329 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

72 changes: 65 additions & 7 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,105 @@ on:
pull_request:
branches:
- master
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
env-job:
runs-on: ubuntu-latest
outputs:
modified-branch-name: ${{ steps.env.outputs.MODIFIED_BRANCH_NAME }}
name: Modify branch name
steps:
- name: Sets MODIFIED_BRANCH_NAME
id: env
env:
name: "${{env.BRANCH_NAME}}"
run: |
echo "MODIFIED_BRANCH_NAME=${name//\//-}" >> ${GITHUB_OUTPUT}
cat ${GITHUB_OUTPUT}
buildTest:
name: Build & Run Unit-Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- uses: gradle/wrapper-validation-action@v1
- name: Build project
run: ./gradlew assembleDebug
- name: Run tests
run: ./gradlew test
- name: Jacoco
run: ./gradlew :tracker:jacocoTestReport
run: ./gradlew :tracker:jacocoTestReport --no-daemon
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
Check:
name: Check
runs-on: ubuntu-latest
needs:
- env-job
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Code checks
run: ./gradlew check
- name: Archive Lint report
uses: actions/[email protected].2
uses: actions/[email protected].3
if: ${{ always() }}
with:
name: Matomo-Lint-report
name: Matomo-Lint-${{ needs.env-job.outputs.modified-branch-name }}
path: tracker/build/reports/lint-results.html

EspressoTest:
runs-on: macOS-latest
needs:
- env-job
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: show envs
run: |
echo ${{ needs.env-job.outputs.modified-branch-name }}
- name: prepare
run: brew install exiftool imagemagick
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.4
- name: Run instrumentation tests
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.4
with:
cmd: ./gradlew cAT --continue
api: 30
tag: default
abi: x86_64
cmdOptions: -noaudio -no-boot-anim -no-window
- name: Archive Espresso results
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: matomo-Espresso-${{ needs.env-job.outputs.modified-branch-name }}
path: |
./**/build/reports/androidTests/connected
./**/build/outputs
!./**/build/outputs/apk
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Build project
run: ./gradlew assembleRelease
env:
Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
buildscript {
ext.kotlin_version = '1.9.10'
repositories {
google()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.5'
classpath 'com.android.tools.build:gradle:8.1.2'
classpath "com.mxalbert.gradle:jacoco-android:0.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://jitpack.io' }
}
ext {
globalMinSdkVersion = 19
globalTargetSdkVersion = 33
globalCompileSdkVersion = 33
timberVersion = '5.0.1'
}
}
25 changes: 21 additions & 4 deletions exampleapp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
id 'kotlin-android'
}

android {
compileSdkVersion project.ext.globalCompileSdkVersion

defaultConfig {
applicationId "org.matomo.demo"
minSdkVersion project.ext.globalMinSdkVersion
compileSdk project.ext.globalCompileSdkVersion
targetSdkVersion project.ext.globalTargetSdkVersion
versionCode 2
versionName "2.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments useTestStorageService: 'true'
}
buildTypes {
release {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
namespace 'org.matomo.demo'
}

dependencies {
implementation project(':tracker')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "com.jakewharton.timber:timber:${timberVersion}"
implementation "com.github.AppDevNext.Logcat:LogcatCoreLib:3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

androidTestImplementation "androidx.test.ext:junit-ktx:1.1.5"
androidTestUtil "androidx.test.services:test-services:1.4.2"
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
}
78 changes: 78 additions & 0 deletions exampleapp/src/androidTest/java/org/matomo/demo/SmokeTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package org.matomo.demo

import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.core.graphics.writeToTestStorage
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.screenshot.captureToBitmap
import androidx.test.ext.junit.rules.activityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestName
import org.junit.runner.RunWith
import org.matomo.demo.DemoActivity

@RunWith(AndroidJUnit4::class)
class SmokeTest {

private val WAIT_SLIDER = 600L

@get:Rule
val activityScenarioRule = activityScenarioRule<DemoActivity>()

@get:Rule
var nameRule = TestName()

@Test
fun testExpand() {
onView(withId(R.id.trackMainScreenViewButton)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-trackMainScreenViewButton")

onView(withId(R.id.trackDispatchNow)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-trackDispatchNow")

onView(withId(R.id.trackCustomVarsButton)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-trackCustomVarsButton")

onView(withId(R.id.raiseExceptionButton)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-raiseExceptionButton")

onView(withId(R.id.addEcommerceItemButton)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-addEcommerceItemButton")

onView(withId(R.id.trackEcommerceCartUpdateButton)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-trackEcommerceCartUpdateButton")

onView(withId(R.id.completeEcommerceOrderButton)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-completeEcommerceOrderButton")

onView(withId(R.id.trackGoalButton)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-trackGoalButton")

onView(withId(R.id.goalTextEditView)).perform(click())
onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-goalTextEditView")
}

}
67 changes: 0 additions & 67 deletions exampleapp/src/main/java/org/matomo/demo/DemoApp.java

This file was deleted.

Loading

0 comments on commit f37643b

Please sign in to comment.