Skip to content

Commit

Permalink
Gradle optimizations + Actions builds
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinencounter committed Jun 10, 2024
1 parent 4ac471e commit 7dcea7a
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Test

on:
pull_request:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set +x
run: chmod a+x gradlew
- name: Build and test
run: ./gradlew clean assembleDebug test
- name: Collate tests
if: ${{ true }}
run: |
mkdir -p build/test_results
find . -regextype posix-extended -regex '.*reports/tests/([^/]+?)' -exec cp -r {} build/test_results/ \;
- name: Upload test results
if: ${{ true }}
uses: actions/upload-artifact@v4
with:
name: test-results
path: build/test_results
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-debug
path: TeamCode/build/outputs/apk/debug/TeamCode-debug.apk
3 changes: 3 additions & 0 deletions TeamCode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
annotationProcessor files('lib/OpModeAnnotationProcessor.jar')
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
1 change: 1 addition & 0 deletions build.common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.regex.Pattern

apply plugin: 'com.adarshr.test-logger'
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'

Expand Down
2 changes: 2 additions & 0 deletions build.dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ dependencies {
runtimeOnly 'org.tensorflow:tensorflow-lite:2.12.0'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ buildscript {
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
// Note for FTC Teams: Do not modify this yourself.
// no lol -Miles
classpath 'com.android.tools.build:gradle:8.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.adarshr:gradle-test-logger-plugin:4.0.0"
}
}

Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Allow Gradle to use up to 1 GB of RAM
org.gradle.jvmargs=-Xmx1024M
# Allow Gradle to use up to 2 GB of RAM
org.gradle.jvmargs=-Xmx2048M
android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.nonFinalResIds=true
org.gradle.configuration-cache=true

0 comments on commit 7dcea7a

Please sign in to comment.