Instate shadow jobs (#1923)

This commit is contained in:
Harsh Shandilya 2022-05-25 17:59:04 +05:30 committed by GitHub
parent 5f4bc7fafd
commit 9d3312611e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 117 additions and 25 deletions

View file

@ -15,7 +15,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Decrypt secrets
@ -27,7 +27,7 @@ jobs:
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Build release binaries
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache :app:assembleFreeRelease :app:assembleNonFreeRelease :app:bundleNonFreeRelease
env:

View file

@ -15,7 +15,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Determine publishing task
@ -30,7 +30,7 @@ jobs:
fi
- name: Upload binaries
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache :${{ steps.task-select.outputs.PROJECT }}:publishAllPublicationsToMavenCentralRepository
env:
@ -40,7 +40,7 @@ jobs:
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.NEXUS_PUBLISH_GPG_KEY_PASSWORD }}
- name: Close and release repository
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache closeAndReleaseRepository
env:

View file

@ -17,7 +17,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Decrypt secrets
@ -29,7 +29,7 @@ jobs:
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Build release app
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
env:
SNAPSHOT: "true"
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

View file

@ -39,7 +39,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Update changelog

View file

@ -31,7 +31,7 @@ jobs:
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Copy CI gradle.properties
@ -40,7 +40,7 @@ jobs:
- name: Check codestyle
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache spotlessCheck
@ -65,7 +65,7 @@ jobs:
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Copy CI gradle.properties
@ -74,7 +74,7 @@ jobs:
- name: Run unit tests
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache test -PslimTests
@ -106,7 +106,7 @@ jobs:
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Copy CI gradle.properties
@ -115,7 +115,7 @@ jobs:
- name: Build debug APKs
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache assembleFreeDebug assembleNonFreeDebug
@ -140,7 +140,7 @@ jobs:
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Copy CI gradle.properties
@ -149,7 +149,7 @@ jobs:
- name: Check library API
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache apiCheck
@ -174,7 +174,7 @@ jobs:
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Copy CI gradle.properties
@ -183,7 +183,7 @@ jobs:
- name: Run Lint on debug variants
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache lintDebug
@ -208,7 +208,7 @@ jobs:
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Copy CI gradle.properties
@ -217,6 +217,6 @@ jobs:
- name: Assemble non-free release
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache aNFR

47
.github/workflows/shadow_job.yml vendored Normal file
View file

@ -0,0 +1,47 @@
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
env:
SENTRY_DSN: 'https://public_key@example.com/project_id'
name: Shadow job with latest Gradle and Java
jobs:
shadow-job:
strategy:
fail-fast: false
matrix:
agp-version:
- 7.2.0
- 7.3.0-beta01
- 7.4.0-alpha02
gradle-version:
- wrapper
- nightly
java-version:
- 11
- 17
- 18
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3.3.0
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Run checks
uses: gradle/gradle-build-action@v2.2.0-beta.1
env:
GRADLE_VERSION_OVERRIDE_com_android_tools_build_gradle: ${{ matrix.agp-version }}
with:
arguments: --no-configuration-cache check

View file

@ -14,11 +14,11 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Download new translations from Crowdin
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache crowdin
env:

View file

@ -14,11 +14,11 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3.3.0
with:
distribution: zulu
distribution: temurin
java-version: 17
- name: Download new publicsuffix data
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
with:
arguments: --no-configuration-cache updatePSL
@ -26,7 +26,7 @@ jobs:
run: if [[ $(git diff --binary --stat) != "" ]]; then echo "UPDATED=true" >> $GITHUB_ENV; fi
- name: Verify update publicsuffixes file
uses: gradle/gradle-build-action@v2.1.6
uses: gradle/gradle-build-action@v2.2.0-beta.1
if: "${{ env.UPDATED == 'true' }}"
with:
arguments: --no-configuration-cache :autofill-parser:test -PslimTests

View file

@ -39,3 +39,17 @@ dependencies {
implementation(libs.build.semver)
implementation(libs.build.sentry)
}
configurations.all {
resolutionStrategy.eachDependency {
val overrideName =
"GRADLE_VERSION_OVERRIDE_${requested.group.replace('.', '_')}_${requested.name}"
val overridenVersion = System.getenv(overrideName)
if (!overridenVersion.isNullOrEmpty()) {
project.logger.lifecycle(
"Overriding dependency ${requested.group}:${requested.name} to version ${overridenVersion}"
)
useVersion(overridenVersion)
}
}
}

View file

@ -30,3 +30,17 @@ dependencies {
implementation(libs.build.kotlin)
implementation(libs.build.spotless)
}
configurations.all {
resolutionStrategy.eachDependency {
val overrideName =
"GRADLE_VERSION_OVERRIDE_${requested.group.replace('.', '_')}_${requested.name}"
val overridenVersion = System.getenv(overrideName)
if (!overridenVersion.isNullOrEmpty()) {
project.logger.lifecycle(
"Overriding dependency ${requested.group}:${requested.name} to version ${overridenVersion}"
)
useVersion(overridenVersion)
}
}
}

View file

@ -27,10 +27,27 @@ pluginManagement {
includeGroup("com.google.testing.platform")
}
}
exclusiveContent {
forRepository(::gradlePluginPortal)
filter {
includeModule("com.gradle", "gradle-enterprise-gradle-plugin")
includeModule("com.gradle.enterprise", "com.gradle.enterprise.gradle.plugin")
}
}
mavenCentral()
}
}
plugins { id("com.gradle.enterprise") version "3.10.1" }
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = if (System.getenv("GITHUB_WORKFLOW").isNullOrEmpty()) "no" else "yes"
publishOnFailureIf(!System.getenv("GITHUB_WORKFLOW").isNullOrEmpty())
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {