Update plugin com.gradle.enterprise from 3.13 to 3.13.1 #451
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push | |
concurrency: | |
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. | |
# On main, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke. | |
# More info: https://stackoverflow.com/a/68422069/253468: | |
group: ${{ github.ref == 'refs/heads/main' && format('ci-main-{0}', github.sha) || format('ci-{0}', github.ref) }} | |
cancel-in-progress: true | |
jobs: | |
validate: | |
name: 🦺 Validation | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
steps: | |
- name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository. | |
uses: actions/checkout@v3 | |
- name: Validate Gradle Wrapper JARs. | |
uses: gradle/wrapper-validation-action@v1 | |
build: | |
name: 🔨 Build & Verify | |
needs: validate | |
runs-on: ubuntu-latest | |
# A local build took 20 seconds, CI takes 3 minutes with setup. | |
# Because it's cloud, give it a bit of a buffer and constrain. | |
timeout-minutes: 15 | |
steps: | |
- name: Set up JDK 17. | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: zulu | |
- name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository. | |
uses: actions/checkout@v3 | |
- name: Build & Verify project. | |
id: gradle | |
run: > | |
./gradlew | |
--no-daemon | |
--no-build-cache | |
--continue | |
--stacktrace | |
--scan | |
assemble | |
lint | |
detekt | |
test | |
check | |
violationReportHtml | |
violationCountFile | |
- name: Publish "Gradle" result and Build Scan URL. | |
if: (success() || failure()) && steps.gradle != null && steps.gradle.outputs.result-success != null | |
uses: actions/github-script@v6 | |
with: | |
debug: ${{ secrets.ACTIONS_STEP_DEBUG || false }} | |
script: | | |
const description = ${{ toJSON(fromJSON(steps.gradle.outputs.result-text)) }} | |
await github.rest.repos.createCommitStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
sha: context.sha, | |
state: ${{ toJSON(fromJSON(steps.gradle.outputs.result-success)) }} === true ? "success" : "failure", | |
context: "CI / Build & Verify / Gradle", | |
// Truncate to be sure it fits: | |
// > HttpError: Validation Failed: {"resource":"Status","code":"custom", | |
// > "field":"description","message":"description is too long (maximum is 140 characters)"} | |
// Max length is 140, give some space for potential Unicode. | |
description: description.length > 130 | |
? `${description.substring(0, 130)}…` | |
: description, | |
target_url: ${{ steps.gradle.outputs.build-scan-url && toJSON(fromJSON(steps.gradle.outputs.build-scan-url)) || 'undefined' }} | |
}); | |
- name: Upload "Lint Results" artifact. | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Lint Results HTMLs | |
path: ${{ github.workspace }}/**/build/reports/lint-results*.html | |
- name: Upload "Lint Merged Results" artifact. | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Lint Merged Results | |
path: ${{ github.workspace }}/build/reports/violations.* | |
- name: Fail if there are violations. | |
if: success() || failure() | |
run: | | |
count=$(cat "${{ github.workspace }}/build/reports/violations.count") | |
if [[ "$count" != "0" ]]; then | |
echo "There were $count violations" | |
exit 1 | |
else | |
echo "No violations found." | |
exit 0 | |
fi | |
- name: Upload "Unit Test Results" artifact. | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Unit Test Results | |
path: ${{ github.workspace }}/**/build/reports/tests/*/ | |
- name: Publish "Unit Results" check suite. | |
if: success() || failure() | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
check_name: "🔔 Test: Unit Results" | |
comment_mode: off | |
report_individual_runs: true | |
test_changes_limit: 0 | |
junit_files: ${{ github.workspace }}/**/build/test-results/*/TEST-*.xml | |
- name: Upload "Detekt Results" artifact. | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Detekt Results | |
path: ${{ github.workspace }}/**/build/reports/detekt/detekt.* | |
- name: Upload "Detekt Merged Results" artifact. | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Detekt Merged Results | |
path: ${{ github.workspace }}/build/reports/detekt/merge.* | |
- name: Publish "detekt" GitHub Code Scanning analysis. | |
uses: github/codeql-action/upload-sarif@v2 | |
if: success() || failure() | |
with: | |
checkout_path: ${{ github.workspace }} | |
sarif_file: ${{ github.workspace }}/build/reports/detekt/merge.sarif | |
instrumentation: | |
name: 🧪 Instrumentation Tests | |
needs: validate | |
runs-on: macos-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Set up JDK 17. | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: zulu | |
- name: Checkout ${{ github.ref }} branch in ${{ github.repository }} repository. | |
uses: actions/checkout@v3 | |
- name: Run Instrumentation Tests on emulator. | |
id: gradle | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
script: > | |
./gradlew | |
--no-daemon | |
--no-build-cache | |
--continue | |
--stacktrace | |
--scan | |
connectedCheck | |
mergeAndroidReports | |
- name: Publish "Gradle" result and Build Scan URL. | |
if: (success() || failure()) && steps.gradle != null && steps.gradle.outputs.result-success != null | |
uses: actions/github-script@v6 | |
with: | |
debug: ${{ secrets.ACTIONS_STEP_DEBUG || false }} | |
script: | | |
const description = ${{ toJSON(fromJSON(steps.gradle.outputs.result-text)) }} | |
await github.rest.repos.createCommitStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
sha: context.sha, | |
state: ${{ toJSON(fromJSON(steps.gradle.outputs.result-success)) }} === true ? "success" : "failure", | |
context: "CI / Instrumentation Tests / Gradle", | |
// Truncate to be sure it fits: | |
// > HttpError: Validation Failed: {"resource":"Status","code":"custom", | |
// > "field":"description","message":"description is too long (maximum is 140 characters)"} | |
// Max length is 140, give some space for potential Unicode. | |
description: description.length > 130 | |
? `${description.substring(0, 130)}…` | |
: description, | |
target_url: ${{ steps.gradle.outputs.build-scan-url && toJSON(fromJSON(steps.gradle.outputs.build-scan-url)) || 'undefined' }} | |
}); | |
- name: Upload "Instrumentation Test Results" artifact. | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Instrumentation Test Results | |
# Exclude names with colon: https://issuetracker.google.com/issues/223643506 | |
path: | | |
${{ github.workspace }}/**/build/outputs/androidTest-results/connected/ | |
${{ github.workspace }}/**/build/outputs/connected_android_test_additional_output/ | |
!**/*:* | |
- name: Upload "Instrumentation Merged Results" artifact. | |
if: success() || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Instrumentation Merged Results | |
# Exclude names with colon: https://issuetracker.google.com/issues/223643506 | |
path: | | |
${{ github.workspace }}/build/androidTest-results/ | |
!**/*:* | |
- name: Publish "Instrumentation Results" check suite. | |
if: success() || failure() | |
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
with: | |
check_name: "🔔 Test: Instrumentation Results" | |
comment_mode: off | |
report_individual_runs: true | |
test_changes_limit: 0 | |
junit_files: ${{ github.workspace }}/**/build/outputs/androidTest-results/connected/TEST-*.xml |