Simplify CI: replace setup-gradle with manual cache + chmod #8
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: CI | |
| on: | |
| push: | |
| branches: [ main, master, 'claude/**' ] | |
| pull_request: | |
| branches: [ main, master, 'claude/**' ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: review-plugin | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('review-plugin/**/*.gradle*', 'review-plugin/gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: gradle-${{ runner.os }}- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build plugin | |
| run: ./gradlew buildPlugin | |
| - name: Run tests | |
| run: ./gradlew test | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: review-plugin/build/reports/tests/ | |
| retention-days: 14 | |
| verify-plugin: | |
| name: Verify Plugin Compatibility | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| defaults: | |
| run: | |
| working-directory: review-plugin | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('review-plugin/**/*.gradle*', 'review-plugin/gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: gradle-${{ runner.os }}- | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Verify plugin descriptor | |
| run: ./gradlew verifyPluginConfiguration | |
| - name: Build plugin distribution | |
| run: ./gradlew buildPlugin | |
| - name: Upload plugin artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: review-plugin | |
| path: review-plugin/build/distributions/*.zip | |
| retention-days: 30 |