Perf Gradle Compatibility Tests #97
This file contains hidden or 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: Perf Gradle Compatibility Tests | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # Run daily at 6 AM | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: read | |
| jobs: | |
| performance-plugin: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| # Do not update to version 6, context: https://blog.gradle.org/github-actions-for-gradle-v6 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2 | |
| - name: Run tests | |
| id: tests | |
| run: | | |
| ./gradlew \ | |
| :firebase-perf-gradle:functionalTest --tests \ | |
| "com.google.firebase.perf.plugin.transform.InstrumentationApiCompatTest.gradleBuildRunsInstrumentationForAllVariants_latestGradleAndAgp" | |
| create-issue-on-failure: | |
| needs: performance-plugin | |
| if: failure() | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Create issue | |
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
| with: | |
| script: | | |
| const issueTitle = 'Perf Gradle Compatibility test failed'; | |
| const { data: searchResults } = await github.rest.search.issuesAndPullRequests({ | |
| q: `is:issue is:open repo:${context.repo.owner}/${context.repo.repo} in:title "${issueTitle}"`, | |
| }); | |
| if (searchResults.total_count === 0) { | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: issueTitle, | |
| body: `https://github.com/firebase/firebase-android-sdk/actions/workflows/perf-gradle-compatibility-tests.yml` | |
| assignees: ['tejasd'], | |
| labels: ['bug', 'automated'] | |
| }) | |
| } |