-
Notifications
You must be signed in to change notification settings - Fork 0
Add CI workflow for Kotlin plugin builds with HasConvention diagnostics #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c23ee16
Initial plan
Copilot 777e688
Add Kotlin CI workflow and diagnostics script
Copilot acb6b98
Update CI files to match exact specification
Copilot 7c1bcdc
Fix YAML syntax in kotlin-ci workflow
Copilot 3592899
Add explicit permissions to workflow for security
Copilot 4ef5679
Move inspect_gradle_kotlin_versions.sh to ide-plugins folder
Copilot 256a960
Fix gradlew path - run from ide-plugins directory
Copilot 802b706
Fix artifact name conflicts in matrix build
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| name: 'CI — Build Kotlin plugin on PR commits' | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| push: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
| build-kotlin-plugin: | ||
| name: 'Build (matrix: Java ${{ matrix.java-version }})' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| strategy: | ||
| matrix: | ||
| java-version: [11, 17] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up JDK ${{ matrix.java-version }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: ${{ matrix.java-version }} | ||
|
|
||
| - name: Cache Gradle | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| ide-plugins/.gradle | ||
| key: gradle-${{ matrix.java-version }}-${{ hashFiles('ide-plugins/**/*.gradle*','ide-plugins/**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| gradle-${{ matrix.java-version }}- | ||
|
|
||
| - name: Make wrapper executable | ||
| run: chmod +x ./gradlew | ||
| working-directory: ide-plugins | ||
|
|
||
| - name: Print Gradle info (for debugging) | ||
| run: ./gradlew --no-daemon --version | ||
| working-directory: ide-plugins | ||
|
|
||
| - name: Run diagnostics script (prints wrapper and kotlin plugin references) | ||
| run: | | ||
| mkdir -p ../out | ||
| ./inspect_gradle_kotlin_versions.sh > ../out/ci-diagnostics.txt || true | ||
| working-directory: ide-plugins | ||
| - name: Upload diagnostics | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ci-diagnostics-java-${{ matrix.java-version }} | ||
| path: out/ci-diagnostics.txt | ||
|
|
||
| - name: Full build with stacktrace (capture to file) | ||
| env: | ||
| GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx3g" | ||
| run: | | ||
| set -o pipefail | ||
| ./gradlew build --no-daemon --stacktrace 2>&1 | tee ../gradle-build.log || true | ||
| working-directory: ide-plugins | ||
| - name: Upload build log | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: gradle-build-log-java-${{ matrix.java-version }} | ||
| path: gradle-build.log | ||
|
|
||
| - name: Build Kotlin plugin subproject if present | ||
| run: | | ||
| set -o pipefail | ||
| if ./gradlew :kotlin:tasks --dry-run &>/dev/null; then | ||
| echo "Detected :kotlin subproject -> building it" | ||
| ./gradlew :kotlin:build --no-daemon --stacktrace 2>&1 | tee ../kotlin-subproject-build.log || true | ||
| echo "Uploading kotlin-subproject-build.log" | ||
| ls -la ../kotlin-subproject-build.log || true | ||
| elif ./gradlew :plugin:kotlin:tasks --dry-run &>/dev/null; then | ||
| echo "Detected :plugin:kotlin subproject -> building it" | ||
| ./gradlew :plugin:kotlin:build --no-daemon --stacktrace 2>&1 | tee ../kotlin-subproject-build.log || true | ||
| else | ||
| echo "No explicit kotlin plugin subproject found; running assemble on all projects" | ||
| ./gradlew assemble --no-daemon --stacktrace 2>&1 | tee ../assemble.log || true | ||
| fi | ||
| working-directory: ide-plugins | ||
| - name: Upload kotlin-subproject/build logs if present | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: kotlin-subproject-logs-java-${{ matrix.java-version }} | ||
| path: | | ||
| kotlin-subproject-build.log | ||
| assemble.log | ||
| if: always() |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #!/usr/bin/env bash | ||
| set -eu | ||
|
|
||
| # Print Gradle wrapper distribution URL | ||
| if [ -f gradle/wrapper/gradle-wrapper.properties ]; then | ||
| echo "== gradle-wrapper.properties ==" | ||
| grep -i distributionUrl gradle/wrapper/gradle-wrapper.properties || true | ||
| echo | ||
| fi | ||
|
|
||
| # Print gradle.properties if present | ||
| if [ -f gradle.properties ]; then | ||
| echo "== gradle.properties ==" | ||
| cat gradle.properties || true | ||
| echo | ||
| fi | ||
|
|
||
| # Search for Kotlin Gradle plugin references | ||
| echo "== Kotlin plugin references (searching for kotlin-gradle-plugin and org.jetbrains.kotlin) ==" | ||
| grep -R --line-number --color=never "kotlin-gradle-plugin" || true | ||
| grep -R --line-number --color=never "org.jetbrains.kotlin" || true | ||
|
|
||
| # Print build.gradle(.kts) files header lines to show plugin versions where declared | ||
| for f in $(git ls-files "*.gradle" "*.gradle.kts" 2>/dev/null || true); do | ||
| echo "---- $f ----" | ||
| sed -n '1,200p' "$f" | sed -n '1,60p' | ||
| echo | ||
| done | ||
|
|
||
| # Print settings.gradle(.kts) | ||
| for f in $(git ls-files "settings.gradle" "settings.gradle.kts" 2>/dev/null || true); do | ||
| echo "---- $f ----" | ||
| sed -n '1,200p' "$f" | sed -n '1,60p' | ||
| echo | ||
| done | ||
|
|
||
| # Print the kotlin plugin versions extracted via a rough regex | ||
| echo "== Extracted candidate versions ==" | ||
| grep -R --line-number --color=never "kotlin-gradle-plugin[:=][^\n]*" || true | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.