Skip to content

Commit 242a947

Browse files
authored
Migrate to IntelliJ Gradle Plugin 2.0 (#100)
Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>
1 parent 496762e commit 242a947

File tree

11 files changed

+137
-174
lines changed

11 files changed

+137
-174
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ on:
2020
# Trigger the workflow on any pull request
2121
pull_request:
2222

23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
2327
jobs:
2428

2529
# Prepare environment and build the plugin
@@ -32,13 +36,13 @@ jobs:
3236
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3337
steps:
3438

35-
# Check out current repository
39+
# Check out the current repository
3640
- name: Fetch Sources
3741
uses: actions/checkout@v4
3842

3943
# Validate wrapper
4044
- name: Gradle Wrapper Validation
41-
uses: gradle/wrapper-validation-action@v3.5.0
45+
uses: gradle/actions/wrapper-validation@v3
4246

4347
# Set up Java environment for the next steps
4448
- name: Setup Java
@@ -49,9 +53,7 @@ jobs:
4953

5054
# Setup Gradle
5155
- name: Setup Gradle
52-
uses: gradle/gradle-build-action@v3
53-
with:
54-
gradle-home-cache-cleanup: true
56+
uses: gradle/actions/setup-gradle@v4
5557

5658
# Set environment variables
5759
- name: Export Properties
@@ -69,8 +71,6 @@ jobs:
6971
echo "$CHANGELOG" >> $GITHUB_OUTPUT
7072
echo "EOF" >> $GITHUB_OUTPUT
7173
72-
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
73-
7474
# Build plugin
7575
- name: Build plugin
7676
run: ./gradlew buildPlugin
@@ -100,7 +100,7 @@ jobs:
100100
runs-on: ubuntu-latest
101101
steps:
102102

103-
# Check out current repository
103+
# Check out the current repository
104104
- name: Fetch Sources
105105
uses: actions/checkout@v4
106106

@@ -113,9 +113,7 @@ jobs:
113113

114114
# Setup Gradle
115115
- name: Setup Gradle
116-
uses: gradle/gradle-build-action@v3
117-
with:
118-
gradle-home-cache-cleanup: true
116+
uses: gradle/actions/setup-gradle@v4
119117

120118
# Run tests
121119
- name: Run Tests
@@ -153,9 +151,12 @@ jobs:
153151
tool-cache: false
154152
large-packages: false
155153

156-
# Check out current repository
154+
# Check out the current repository
157155
- name: Fetch Sources
158156
uses: actions/checkout@v4
157+
with:
158+
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
159+
fetch-depth: 0 # a full history is required for pull request analysis
159160

160161
# Set up Java environment for the next steps
161162
- name: Setup Java
@@ -166,7 +167,7 @@ jobs:
166167

167168
# Run Qodana inspections
168169
- name: Qodana - Code Inspection
169-
uses: JetBrains/qodana-action@v2024.2.3
170+
uses: JetBrains/qodana-action@v2024.2
170171
with:
171172
cache-default-branch-only: true
172173

@@ -184,7 +185,7 @@ jobs:
184185
tool-cache: false
185186
large-packages: false
186187

187-
# Check out current repository
188+
# Check out the current repository
188189
- name: Fetch Sources
189190
uses: actions/checkout@v4
190191

@@ -197,9 +198,7 @@ jobs:
197198

198199
# Setup Gradle
199200
- name: Setup Gradle
200-
uses: gradle/gradle-build-action@v3
201-
with:
202-
gradle-home-cache-cleanup: true
201+
uses: gradle/actions/setup-gradle@v4
203202

204203
# Cache Plugin Verifier IDEs
205204
- name: Setup Plugin Verifier IDEs Cache
@@ -231,17 +230,10 @@ jobs:
231230
contents: write
232231
steps:
233232

234-
# Check out current repository
233+
# Check out the current repository
235234
- name: Fetch Sources
236235
uses: actions/checkout@v4
237236

238-
# Set up Java environment for the next steps
239-
- name: Setup Java
240-
uses: actions/setup-java@v4
241-
with:
242-
distribution: zulu
243-
java-version: 17
244-
245237
# Remove old release drafts by using the curl request for the available releases with a draft flag
246238
- name: Remove Old Release Drafts
247239
env:
@@ -256,7 +248,7 @@ jobs:
256248
env:
257249
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
258250
run: |
259-
gh release create v${{ needs.build.outputs.version }} \
251+
gh release create "v${{ needs.build.outputs.version }}" \
260252
--draft \
261253
--title "v${{ needs.build.outputs.version }}" \
262254
--notes "$(cat << 'EOM'

.github/workflows/release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
pull-requests: write
1919
steps:
2020

21-
# Check out current repository
21+
# Check out the current repository
2222
- name: Fetch Sources
2323
uses: actions/checkout@v4
2424
with:
@@ -33,9 +33,7 @@ jobs:
3333

3434
# Setup Gradle
3535
- name: Setup Gradle
36-
uses: gradle/gradle-build-action@v3
37-
with:
38-
gradle-home-cache-cleanup: true
36+
uses: gradle/actions/setup-gradle@v4
3937

4038
# Set environment variables
4139
- name: Export Properties
@@ -51,7 +49,7 @@ jobs:
5149
echo "$CHANGELOG" >> $GITHUB_OUTPUT
5250
echo "EOF" >> $GITHUB_OUTPUT
5351
54-
# Update Unreleased section with the current release note
52+
# Update the Unreleased section with the current release note
5553
- name: Patch Changelog
5654
if: ${{ steps.properties.outputs.changelog != '' }}
5755
env:
@@ -61,7 +59,6 @@ jobs:
6159
6260
# Publish the plugin to JetBrains Marketplace
6361
# - name: Publish Plugin
64-
# continue-on-error: true # Artem: skip for testing
6562
# env:
6663
# PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
6764
# CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}

.github/workflows/run-ui-tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333

34-
# Check out current repository
34+
# Check out the current repository
3535
- name: Fetch Sources
3636
uses: actions/checkout@v4
3737

@@ -44,9 +44,7 @@ jobs:
4444

4545
# Setup Gradle
4646
- name: Setup Gradle
47-
uses: gradle/gradle-build-action@v3
48-
with:
49-
gradle-home-cache-cleanup: true
47+
uses: gradle/actions/setup-gradle@v4
5048

5149
# Run IDEA prepared for UI testing
5250
- name: Run IDE

0 commit comments

Comments
 (0)