This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Nightly #40
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: Nightly | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| verify-generated-project: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| gradle_command: ./gradlew | |
| - os: macos-latest | |
| gradle_command: ./gradlew | |
| - os: windows-latest | |
| gradle_command: .\gradlew.bat | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| token: ${{ github.token }} | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Run formatting, unit tests, and integration tests | |
| run: ${{ matrix.gradle_command }} spotlessCheck test integrationTest --no-daemon | |
| - name: Check npm package | |
| run: ${{ matrix.gradle_command }} npmPackageCheck --no-daemon | |
| - name: Report scheduled failure | |
| if: failure() && github.event_name == 'schedule' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const owner = context.repo.owner | |
| const repo = context.repo.repo | |
| const title = 'Nightly workflow failure' | |
| const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${context.runId}` | |
| const body = [ | |
| 'The nightly workflow failed.', | |
| '', | |
| `- Workflow: ${context.workflow}`, | |
| `- Run: ${runUrl}`, | |
| `- Commit: ${context.sha}`, | |
| `- Ref: ${context.ref}`, | |
| ].join('\n') | |
| const { data: issues } = await github.rest.issues.listForRepo({ | |
| owner, | |
| repo, | |
| state: 'open', | |
| per_page: 100, | |
| }) | |
| const existing = issues.find((issue) => issue.title === title) | |
| if (existing) { | |
| await github.rest.issues.createComment({ | |
| owner, | |
| repo, | |
| issue_number: existing.number, | |
| body, | |
| }) | |
| core.info(`Added failure comment to issue #${existing.number}`) | |
| } else { | |
| const created = await github.rest.issues.create({ | |
| owner, | |
| repo, | |
| title, | |
| body, | |
| }) | |
| core.info(`Created issue #${created.data.number}`) | |
| } |