Skip to content

Commit dce2446

Browse files
CopilotMte90
andauthored
Fix CI workflows: align build-plugin.yml with kotlin-ci.yml and add path filtering (#22)
Co-authored-by: Mte90 <403283+Mte90@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent be3da6d commit dce2446

File tree

2 files changed

+42
-10
lines changed

2 files changed

+42
-10
lines changed

.github/workflows/build-plugin.yml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,69 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
1113

1214
steps:
13-
- uses: actions/checkout@v3
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1419

1520
- name: Set up JDK 17
16-
uses: actions/setup-java@v3
21+
uses: actions/setup-java@v4
1722
with:
1823
java-version: '17'
1924
distribution: 'temurin'
2025

21-
- name: Setup Gradle
22-
uses: gradle/gradle-build-action@v2
26+
- name: Cache Gradle
27+
uses: actions/cache@v4
28+
with:
29+
path: |
30+
~/.gradle/caches
31+
~/.gradle/wrapper
32+
ide-plugins/.gradle
33+
key: gradle-17-${{ hashFiles('ide-plugins/**/*.gradle*','ide-plugins/**/gradle-wrapper.properties') }}
34+
restore-keys: |
35+
gradle-17-
2336
24-
- name: Build plugin
37+
- name: Setup Gradle wrapper if missing
2538
run: |
26-
cd ide-plugins
27-
./gradlew buildPlugin
39+
if [ ! -f gradlew ] || [ ! -f gradle/wrapper/gradle-wrapper.jar ]; then
40+
echo "Setting up Gradle wrapper for Gradle 9.2.0..."
41+
cd /tmp
42+
curl -L -s -o gradle-9.2.0.zip https://services.gradle.org/distributions/gradle-9.2.0-bin.zip
43+
unzip -q gradle-9.2.0.zip
44+
cd $GITHUB_WORKSPACE/ide-plugins
45+
/tmp/gradle-9.2.0/bin/gradle wrapper --gradle-version 9.2.0
46+
chmod +x gradlew
47+
echo "Wrapper installed"
48+
fi
49+
working-directory: ide-plugins
50+
51+
- name: Build plugin
52+
env:
53+
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx3g"
54+
run: ./gradlew buildPlugin --no-daemon --stacktrace
55+
working-directory: ide-plugins
2856

2957
- name: Get plugin version
3058
id: plugin_version
3159
run: |
32-
cd ide-plugins
3360
VERSION=$(grep "^version" build.gradle.kts | cut -d'"' -f2)
3461
echo "version=$VERSION" >> $GITHUB_OUTPUT
62+
working-directory: ide-plugins
3563

3664
- name: Upload plugin artifact
3765
uses: actions/upload-artifact@v4
3866
with:
3967
name: picocode-plugin-${{ steps.plugin_version.outputs.version }}
40-
path: plugin/build/distributions/*.zip
68+
path: ide-plugins/build/distributions/*.zip
4169

4270
- name: Upload to Release
4371
if: github.event_name == 'release'
4472
uses: softprops/action-gh-release@v1
4573
with:
46-
files: plugin/build/distributions/*.zip
74+
files: ide-plugins/build/distributions/*.zip
4775
env:
4876
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/kotlin-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: 'CI — Build Kotlin plugin on PR commits'
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened]
6+
paths:
7+
- 'ide-plugins/**'
68
push:
79
branches: [ "main" ]
10+
paths:
11+
- 'ide-plugins/**'
812

913
jobs:
1014
build-kotlin-plugin:

0 commit comments

Comments
 (0)