Verify Build (Nightly) #54
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: Verify Build (Nightly) | |
| permissions: | |
| contents: read | |
| id-token: write | |
| on: | |
| schedule: | |
| - cron: '0 4 * * *' | |
| push: | |
| paths: | |
| - ".github/workflows/build-verification-nightly.yml" | |
| workflow_dispatch: | |
| jobs: | |
| verification: | |
| name: Verification | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| develocity-access-key: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }} | |
| gradle-version: 'release-candidate' | |
| - name: Build and publish to Maven Local with Gradle | |
| run: gradle build publishToMavenLocal -x signPluginMavenPublication -i -Porg.gradle.java.installations.auto-download=false | |
| env: | |
| DISABLE_REQUIRED_SIGNING: true | |
| - name: Upload published plugin | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: common-custom-user-data-gradle-plugin | |
| path: ~/.m2/repository/com/gradle | |
| local-test: | |
| name: Test with Locally Published Plugin | |
| runs-on: ubuntu-latest | |
| needs: verification | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| gradle-version: ['current', 'release-candidate', 'nightly'] | |
| java-version: ['21'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'temurin' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| develocity-access-key: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }} | |
| gradle-version: '${{ matrix.gradle-version }}' | |
| - name: Download plugin to maven local | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: common-custom-user-data-gradle-plugin | |
| path: ~/.m2/repository/com/gradle | |
| - name: Create the test project | |
| run: | | |
| echo """ | |
| pluginManagement { | |
| repositories { | |
| gradlePluginPortal() | |
| exclusiveContent { | |
| forRepository { | |
| mavenLocal() | |
| } | |
| filter { | |
| includeModule(\"com.gradle\", \"common-custom-user-data-gradle-plugin\") | |
| includeModule(\"com.gradle.common-custom-user-data-gradle-plugin\", \"com.gradle.common-custom-user-data-gradle-plugin.gradle.plugin\") | |
| } | |
| } | |
| } | |
| } | |
| plugins { | |
| id(\"com.gradle.develocity\") version \"4+\" | |
| id(\"com.gradle.common-custom-user-data-gradle-plugin\") version \"2+\" | |
| } | |
| develocity { | |
| server = \"https://ge.solutions-team.gradle.com\" | |
| } | |
| rootProject.name = \"ccud-test-gradle-${{ matrix.gradle-version }}\" | |
| """ > ${{ runner.temp }}/settings.gradle | |
| echo """ | |
| org.gradle.vfs.watch=true | |
| org.gradle.daemon=true | |
| org.gradle.parallel=true | |
| org.gradle.caching=true | |
| org.gradle.configuration-cache=true | |
| org.gradle.unsafe.configuration-cache=true | |
| org.gradle.jvmargs=-Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 | |
| """ > ${{ runner.temp }}/gradle.properties | |
| - name: Run a build with the locally published plugin | |
| run: gradle help "-Dscan.value.gradle-version=${{ matrix.gradle-version }}" "-Dscan.value.java-version=${{ matrix.java-version }}" | |
| working-directory: ${{ runner.temp }} | |
| failure-notification: | |
| name: Matrix failure notification | |
| runs-on: ubuntu-latest | |
| needs: | |
| - verification | |
| - local-test | |
| if: failure() | |
| steps: | |
| - name: Get secrets | |
| uses: gradle/actions-internal/get-aws-secrets@v1 | |
| with: | |
| role-to-assume: arn:aws:iam::992382829881:role/GHASecrets_common-custom-user-data-gradle-plugin_all | |
| secret-ids: | | |
| DV_SOLUTIONS_SCHEDULED_WORKFLOWS_WEBHOOK_URL,gha/common-custom-user-data-gradle-plugin/_all/dv_solutions_scheduled_workflows_webhook_url | |
| - name: Report scheduled workflow failure | |
| uses: slackapi/[email protected] | |
| with: | |
| webhook: ${{ env.DV_SOLUTIONS_SCHEDULED_WORKFLOWS_WEBHOOK_URL }} | |
| webhook-type: webhook-trigger | |
| payload-templated: true | |
| payload: | | |
| { | |
| "workflow_name": "CCUD Gradle: Verify Build (Nightly)", | |
| "workflow_run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| } |