Turn on Configuration Cache (#1733)

This commit is contained in:
Harsh Shandilya 2022-02-17 10:13:04 +05:30 committed by GitHub
parent c83ce48196
commit c9992a64fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 97 additions and 87 deletions

View file

@ -13,11 +13,11 @@ jobs:
uses: actions/checkout@v2.4.0
- name: Set up JDK
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Decrypt secrets
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
@ -30,7 +30,7 @@ jobs:
- name: Build release binaries
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: :app:assembleFreeRelease :app:assembleNonFreeRelease :app:bundleNonFreeRelease
arguments: --no-configuration-cache :app:assembleFreeRelease :app:assembleNonFreeRelease :app:bundleNonFreeRelease
- name: Upload non-free release APK
uses: actions/upload-artifact@v2.3.1

View file

@ -1,4 +1,4 @@
name: "Release library subprojects"
name: Release library subprojects
on:
push:
tags:
@ -13,11 +13,11 @@ jobs:
uses: actions/checkout@v2.4.0
- name: Set up JDK
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Determine publishing task
id: task-select
@ -33,7 +33,7 @@ jobs:
- name: Upload binaries
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: :${{ steps.task-select.outputs.PROJECT }}:publishAllPublicationsToMavenCentralRepository
arguments: --no-configuration-cache :${{ steps.task-select.outputs.PROJECT }}:publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
@ -43,7 +43,7 @@ jobs:
- name: Close and release repository
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: closeAndReleaseRepository
arguments: --no-configuration-cache closeAndReleaseRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}

View file

@ -13,11 +13,11 @@ jobs:
uses: actions/checkout@v2.4.0
- name: Set up JDK
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Decrypt secrets
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
@ -32,7 +32,7 @@ jobs:
env:
SNAPSHOT: "true"
with:
arguments: :app:assembleFreeRelease :app:assembleNonFreeRelease
arguments: --no-configuration-cache :app:assembleFreeRelease :app:assembleNonFreeRelease
- name: Clean secrets
run: scripts/signing-cleanup.sh

View file

@ -1,4 +1,4 @@
name: "Draft new release"
name: Draft new release
on:
milestone:
@ -6,10 +6,11 @@ on:
jobs:
draft-new-release:
name: "Draft a new release"
name: Draft a new release
runs-on: ubuntu-latest
steps:
- name: Extract version from milestone
shell: bash
run: |
VERSION="${{ github.event.milestone.title }}"
RELEASE_VERSION="${VERSION/v/}"
@ -36,11 +37,11 @@ jobs:
ref: ${{ env.CHECKOUT_REF }}
- name: Set up JDK
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
@ -48,6 +49,7 @@ jobs:
version: ${{ github.event.milestone.title }}
- name: Initialize git config and commit changes
shell: bash
run: |
# Configure name and email for Actions user
git config user.name "GitHub Actions"
@ -68,9 +70,9 @@ jobs:
# that the version number is already correct, and we only need to drop the
# -SNAPSHOT suffix.
if [[ "${CHECKOUT_REF}" == "develop" ]]; then
./gradlew clearPreRelease
./gradlew --no-configuration-cache --no-daemon clearPreRelease
else
./gradlew bumpPatch
./gradlew --no-configuration-cache --no-daemon bumpPatch
fi
# Commit changes to the versioning

View file

@ -26,11 +26,11 @@ jobs:
- name: Set up JDK
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Copy CI gradle.properties
if: ${{ steps.service-changed.outputs.result == 'true' }}
@ -40,7 +40,7 @@ jobs:
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: spotlessCheck
arguments: --no-configuration-cache spotlessCheck
unit-tests:
runs-on: ubuntu-latest
@ -61,11 +61,11 @@ jobs:
- name: Set up JDK
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Copy CI gradle.properties
if: ${{ steps.service-changed.outputs.result == 'true' }}
@ -75,7 +75,7 @@ jobs:
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: test -PslimTests
arguments: --no-configuration-cache test -PslimTests
- name: (Fail-only) Upload test report
if: failure()
@ -103,11 +103,11 @@ jobs:
- name: Set up JDK
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Copy CI gradle.properties
if: ${{ steps.service-changed.outputs.result == 'true' }}
@ -117,7 +117,7 @@ jobs:
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: assembleFreeDebug assembleNonFreeDebug
arguments: --no-configuration-cache assembleFreeDebug assembleNonFreeDebug
check-api:
runs-on: ubuntu-latest
@ -138,11 +138,11 @@ jobs:
- name: Set up JDK
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Copy CI gradle.properties
if: ${{ steps.service-changed.outputs.result == 'true' }}
@ -152,7 +152,7 @@ jobs:
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: apiCheck
arguments: --no-configuration-cache apiCheck
lint-debug:
runs-on: ubuntu-latest
@ -173,11 +173,11 @@ jobs:
- name: Set up JDK
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Copy CI gradle.properties
if: ${{ steps.service-changed.outputs.result == 'true' }}
@ -187,4 +187,4 @@ jobs:
if: ${{ steps.service-changed.outputs.result == 'true' }}
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: lintDebug
arguments: --no-configuration-cache lintDebug

View file

@ -12,14 +12,16 @@ jobs:
uses: actions/checkout@v2.4.0
- name: Set up JDK
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Download new translations from Crowdin
run: ./gradlew crowdin
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: --no-configuration-cache crowdin
env:
CROWDIN_LOGIN: ${{ secrets.CROWDIN_LOGIN }}
CROWDIN_PROJECT_KEY: ${{ secrets.CROWDIN_PROJECT_KEY }}

View file

@ -2,7 +2,7 @@ name: Update Publix Suffix List data
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 6'
- cron: "0 0 * * 6"
jobs:
update-publicsuffix-data:
@ -12,30 +12,30 @@ jobs:
uses: actions/checkout@v2.4.0
- name: Set up JDK
uses : actions/setup-java@v2.4.0
with :
distribution : 'zulu'
java-version : '17'
cache: 'gradle'
uses: actions/setup-java@v2.4.0
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Download new publicsuffix data
uses: gradle/gradle-build-action@v2.1.3
with:
arguments: updatePSL
arguments: --no-configuration-cache updatePSL
- name: Compare list changes
run: if [[ $(git diff --binary --stat) != '' ]]; then echo "UPDATED=true" >> $GITHUB_ENV; fi
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.3
if: env.UPDATED == 'true'
if: env.UPDATED == "true"
with:
arguments: :autofill-parser:test -PslimTests
arguments: --no-configuration-cache :autofill-parser:test -PslimTests
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3.12.1
if: env.UPDATED == 'true'
if: env.UPDATED == "true"
with:
assignees: msfjarvis
author: GitHub Actions <noreply@github.com>
@ -48,7 +48,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Close, re-open and enable squash merge for PR
if: steps.cpr.outputs.pull-request-operation == 'created'
if: steps.cpr.outputs.pull-request-operation == "created"
shell: bash
run: |
gh pr close "${PR_URL}"

View file

@ -1,16 +1,19 @@
name: "Validate Gradle Wrapper"
name: Validate Gradle Wrapper
on:
pull_request:
paths:
- '.github/workflows/validate_gradle_wrapper.yml'
- 'gradle/**'
- 'gradlew'
- 'gradlew.bat'
- ".github/workflows/validate_gradle_wrapper.yml"
- "gradle/**"
- "gradlew"
- "gradlew.bat"
jobs:
validation:
name: "Wrapper validation"
name: Wrapper validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: gradle/wrapper-validation-action@v1.0.4
- name: Checkout repository
uses: actions/checkout@v2.4.0
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1.0.4

View file

@ -28,7 +28,7 @@ class CrowdinDownloadPlugin : Plugin<Project> {
override fun apply(project: Project) {
with(project) {
val buildDirectory = layout.buildDirectory.asFile
val buildDirectory = layout.buildDirectory.asFile.get()
val extension = extensions.create<CrowdinExtension>("crowdin")
afterEvaluate {
val projectName = extension.projectName
@ -55,7 +55,7 @@ class CrowdinDownloadPlugin : Plugin<Project> {
.build()
val url = CROWDIN_BUILD_API_URL.format(projectName, login.get(), key.get())
val request = Request.Builder().url(url).get().build()
client.newCall(request).execute()
client.newCall(request).execute().close()
}
}
val downloadCrowdin =

View file

@ -9,6 +9,9 @@ org.gradle.caching=true
# Enable filesystem watching
org.gradle.vfs.watch=true
# Enable experimental configuration caching
org.gradle.unsafe.configuration-cache=true
# Enable Kotlin incremental compilation
kotlin.incremental=true