This repository was archived by the owner on Jan 24, 2026. It is now read-only.
chore: integrate Google Java Format with Gradle #11
Workflow file for this run
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: Code Quality | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| format-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 # Shallow clone for faster checkout | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: 'gradle' | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Cache Google Java Format | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/google-java-format | |
| key: ${{ runner.os }}-google-java-format-1.22.0 | |
| - name: Check Java formatting and compile (parallel) | |
| run: ./gradlew checkJavaFormat compileJava --parallel --max-workers=4 | |
| - name: Run tests | |
| run: ./gradlew test --parallel --max-workers=4 | |
| - name: Cleanup Gradle Cache | |
| # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | |
| # Restoring these files from a GitHub Actions cache might cause problems for future builds. | |
| run: | | |
| rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
| rm -f ~/.gradle/caches/modules-2/gc.properties |