Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Actions #4

Merged
merged 21 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a144d76
New build.yaml action
duartebarbosadev Jan 20, 2025
4746082
New build.yaml action
duartebarbosadev Jan 20, 2025
b5c62f5
New build.yaml action
duartebarbosadev Jan 22, 2025
80ab639
New build.yaml action
duartebarbosadev Jan 22, 2025
e580eb0
New build.yaml action
duartebarbosadev Jan 22, 2025
d6c561f
New build.yaml action
duartebarbosadev Jan 22, 2025
eec3035
Fixed buildLogic wrong project name
duartebarbosadev Jan 22, 2025
4530f03
Concurrency and gradle properties
duartebarbosadev Jan 22, 2025
fdade7b
Concurrency and gradle properties
duartebarbosadev Jan 22, 2025
34db544
Updated gradlew permissions
duartebarbosadev Jan 22, 2025
2424f90
Merge branch 'main' of https://github.com/DuarteBarbosaPT/Scrolless i…
duartebarbosadev Jan 23, 2025
4085b3a
Merge branch 'main' into 3-github-actions---build-project
duartebarbosadev Jan 23, 2025
9d943c6
Updated gradlew permissions
duartebarbosadev Jan 23, 2025
3601d97
Merge remote-tracking branch 'origin/3-github-actions---build-project…
duartebarbosadev Jan 23, 2025
d082ddd
Updated gradlew permissions
duartebarbosadev Jan 23, 2025
e9864fb
Changed google-services but this should be temporary
duartebarbosadev Jan 23, 2025
ce40182
Changed google-services
duartebarbosadev Jan 23, 2025
95c84f7
Changed google-services
duartebarbosadev Jan 23, 2025
98110f0
Fixed firebase which was trying to upload mapping
duartebarbosadev Jan 24, 2025
ed2ec23
Removed libs for now
duartebarbosadev Jan 24, 2025
3e2d29c
Update build.yaml
duartebarbosadev Jan 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/gradle-ci.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kotlin.incremental=false
warningsAsErrors=false

org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.workers.max=2
org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true

78 changes: 78 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build

on:
push:
branches:
- main
pull_request:

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
test_and_apk:
name: "Local tests and APKs"
runs-on: ubuntu-latest

timeout-minutes: 60

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/gradle-ci.properties ~/.gradle/gradle.properties

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}

- name: Check build-logic
run: ./gradlew :buildLogic:convention:check

- name: Check spotless
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache

# Run local tests
- name: Run local tests
run: ./gradlew testDevDebug

- name: Build all build type and flavor permutations
run: ./gradlew :app:assemble

- name: Upload build outputs (APKs)
uses: actions/upload-artifact@v4
with:
name: APKs
path: '**/build/outputs/apk/**/*.apk'

- name: Upload JVM local results (XML)
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: local-test-results
path: '**/build/test-results/test*UnitTest/**.xml'

- name: Check lint
run: ./gradlew :app:lintProdRelease

- name: Upload lint reports (HTML)
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: lint-reports
path: '**/build/reports/lint-results-*.html'

- name: Upload lint reports (SARIF)
if: ${{ !cancelled() && hashFiles('**/*.sarif') != '' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: './'
3 changes: 0 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ plugins {
alias(libs.plugins.scrolless.android.application.flavors)
alias(libs.plugins.scrolless.android.application.firebase)
alias(libs.plugins.scrolless.hilt)
id("com.google.android.gms.oss-licenses-plugin")
alias(libs.plugins.kotlin.android)
}

Expand Down Expand Up @@ -137,7 +136,5 @@ dependencies {

implementation(libs.firebase.crashlytics)

implementation(libs.google.oss.licenses)

implementation(libs.facebook.shimmer)
}
86 changes: 86 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"project_info": {
"project_number": "YourProjectId",
"project_id": "abc",
"storage_bucket": "abc"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "Your:App:Id",
"android_client_info": {
"package_name": "com.scrolless.app"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "APIKeyPlaceholder"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "Your:App:Id",
"android_client_info": {
"package_name": "com.scrolless.app.dev.debug"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "APIKeyPlaceholder"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "Your:App:Id",
"android_client_info": {
"package_name": "com.scrolless.app.debug"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "APIKeyPlaceholder"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "Your:App:Id",
"android_client_info": {
"package_name": "com.scrolless.app.dev"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "APIKeyPlaceholder"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
7 changes: 0 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ buildscript {
mavenCentral()
gradlePluginPortal()
}

dependencies {
classpath(libs.google.oss.licenses.plugin) {
exclude(group = "com.google.protobuf")
}
}
}

plugins {
Expand All @@ -22,5 +16,4 @@ plugins {
alias(libs.plugins.firebase.perf) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.module.graph) apply true // Plugin applied to allow module graph generation
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import com.android.build.api.dsl.ApplicationExtension
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
import com.android.build.gradle.BaseExtension
import com.scrolless.app.configureBadgingTasks
import com.scrolless.app.configureKotlinAndroid
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.getByType

class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
Expand All @@ -22,9 +18,6 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
@Suppress("UnstableApiUsage")
testOptions.animationsDisabled = true
}
extensions.configure<ApplicationAndroidComponentsExtension> {
configureBadgingTasks(extensions.getByType<BaseExtension>(), this)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AndroidApplicationFirebaseConventionPlugin : Plugin<Project> {
// enabled if a Firebase backend is available and configured in
// google-services.json.
configure<CrashlyticsExtension> {
mappingFileUploadEnabled = true
mappingFileUploadEnabled = false
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
* limitations under the License.
*/

import com.android.build.api.variant.LibraryAndroidComponentsExtension
import com.android.build.gradle.LibraryExtension
import com.scrolless.app.configureFlavors
import com.scrolless.app.configureKotlinAndroid
import com.scrolless.app.disableUnnecessaryAndroidTests
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
Expand Down Expand Up @@ -50,9 +48,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
.joinToString(separator = "_")
.lowercase() + "_"
}
extensions.configure<LibraryAndroidComponentsExtension> {
disableUnnecessaryAndroidTests(target)
}
dependencies {
add("androidTestImplementation", kotlin("test"))
add("testImplementation", kotlin("test"))
Expand Down

This file was deleted.

Loading
Loading