diff --git a/.github/actions/common-steps/action.yml b/.github/actions/common-steps/action.yml index af293a7bb..238b64fa0 100644 --- a/.github/actions/common-steps/action.yml +++ b/.github/actions/common-steps/action.yml @@ -2,6 +2,11 @@ name: Common Steps description: Common steps for Katana workflows +inputs: + gradle-encryption-key: + description: 'Encryption key for Gradle cache' + required: true + runs: using: composite steps: @@ -11,6 +16,13 @@ runs: distribution: zulu java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@v3.0.0 + uses: gradle/actions/setup-gradle@v3.0.0 with: + add-job-summary-as-pr-comment: on-failure + artifact-retention-days: 7 + build-scan-publish: true + build-scan-terms-of-service-url: https://gradle.com/terms-of-service + build-scan-terms-of-service-agree: yes + cache-encryption-key: ${{ inputs.gradle-encryption-key }} dependency-graph: generate-and-submit + gradle-home-cache-cleanup: true diff --git a/.github/workflows/katana.yml b/.github/workflows/katana.yml index 4381d51fd..8041d07d5 100644 --- a/.github/workflows/katana.yml +++ b/.github/workflows/katana.yml @@ -51,8 +51,10 @@ jobs: fetch-depth: 0 - name: Common Steps uses: ./.github/actions/common-steps + with: + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Assemble Katana - run: ./gradlew assembleDebug --no-daemon --scan --stacktrace + run: ./gradlew assembleDebug --no-daemon --stacktrace - name: Upload compose reports artifact uses: actions/upload-artifact@v4.3.0 if: always() @@ -94,6 +96,8 @@ jobs: fetch-depth: 0 - name: Common Steps uses: ./.github/actions/common-steps + with: + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Run detekt run: ./gradlew detektAll lintDebug --no-daemon --stacktrace - name: Upload static reports artifact @@ -120,8 +124,10 @@ jobs: fetch-depth: 0 - name: Common Steps uses: ./.github/actions/common-steps + with: + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Run unit tests - run: ./gradlew :koverXmlReport :koverVerify --no-daemon --scan --stacktrace + run: ./gradlew :koverXmlReport :koverVerify --no-daemon --stacktrace - name: Upload tests reports artifact uses: actions/upload-artifact@v4.3.0 with: @@ -150,6 +156,8 @@ jobs: fetch-depth: 0 - name: Common Steps uses: ./.github/actions/common-steps + with: + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Decode keystore uses: timheuer/base64-to-file@v1.2.4 with: @@ -170,7 +178,7 @@ jobs: SENTRY_PROJECT: ${{ secrets.SENTRY_ANDROID_BETA_PROJECT }} SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - run: ./gradlew assembleBeta -Pkatana.flavor=beta --no-daemon --scan --stacktrace + run: ./gradlew assembleBeta -Pkatana.flavor=beta --no-daemon --stacktrace - name: Publish beta APK to TestApp.io uses: testappio/github-action@v5 with: @@ -212,6 +220,8 @@ jobs: fetch-depth: 0 - name: Common Steps uses: ./.github/actions/common-steps + with: + gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Decode keystore uses: timheuer/base64-to-file@v1.2.4 with: @@ -227,7 +237,7 @@ jobs: SENTRY_PROJECT: ${{ secrets.SENTRY_ANDROID_RELEASE_PROJECT }} SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - run: ./gradlew assembleRelease bundleRelease -Pkatana.flavor=release --no-daemon --scan --stacktrace + run: ./gradlew assembleRelease bundleRelease -Pkatana.flavor=release --no-daemon --stacktrace - name: Publish production AAB to Google Play uses: r0adkll/upload-google-play@v1.1.2 with: diff --git a/init.gradle.kts b/init.gradle.kts new file mode 100644 index 000000000..7b69d514a --- /dev/null +++ b/init.gradle.kts @@ -0,0 +1,14 @@ +import org.gradle.github.GitHubDependencyGraphPlugin + +initscript { + repositories { + maven { + url = uri("https://plugins.gradle.org/m2/") + } + } + dependencies { + classpath("org.gradle:github-dependency-graph-gradle-plugin:1.2.0") + } +} + +apply()