Skip to content

Commit 0496c8e

Browse files
committed
Periodically check against latest versions of IDEA
1 parent e5fcea9 commit 0496c8e

File tree

3 files changed

+154
-31
lines changed

3 files changed

+154
-31
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,7 @@ jobs:
8080

8181
check-compatibility:
8282

83-
name: Test Plugin Compatibility (${{ matrix.idea-release }})
84-
runs-on: ubuntu-latest
83+
uses: ./.github/workflows/check-compatibility.yml
8584
needs: build
86-
87-
strategy:
88-
fail-fast: false
89-
matrix:
90-
idea-release: ${{ fromJSON(needs.build.outputs.products-releases) }}
91-
92-
steps:
93-
# Setup environment
94-
- name: Checkout repository
95-
uses: actions/checkout@v4
96-
- name: Set up build tools
97-
uses: ./.github/actions/setup-tools
98-
# Setup caches for Plugin Verifier
99-
- name: Set up cache for IntelliJ Plugin Verifier
100-
uses: actions/cache@v4
101-
with:
102-
path: ~/.cache/pluginVerifier/ides
103-
key: pluginVerifier-${{ matrix.idea-release }}-${{ runner.os }}
104-
# Run checks
105-
- name: Check plugin compatibility
106-
run: ./gradlew --stacktrace -PverifierIdeVersionOverride="${{ matrix.idea-release }}" verifyPlugin
107-
# Upload artifacts
108-
- name: Upload build reports
109-
if: always()
110-
uses: actions/upload-artifact@v4
111-
with:
112-
name: compatibility-reports-${{ matrix.idea-release }}
113-
path: build/reports/
114-
if-no-files-found: ignore
85+
with:
86+
products_releases: ${{ needs.build.outputs.products-releases }}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Check Against Latest Versions of IDEA
2+
3+
on:
4+
schedule:
5+
- cron: '35 14 * * 5' # Every Friday 14:35 UTC
6+
workflow_dispatch:
7+
inputs:
8+
update_repo:
9+
description: 'Push updated files to repository'
10+
default: false
11+
type: boolean
12+
13+
jobs:
14+
update-products-releases:
15+
16+
name: Check for New Product Releases of IDEA
17+
runs-on: ubuntu-latest
18+
outputs:
19+
artifact-id: ${{ steps.upload.outputs.artifact-id }}
20+
products-releases: ${{ steps.get-new-products-releases.outputs.products-releases }}
21+
has-changed: ${{ steps.diff.outputs.has-changes }}
22+
23+
steps:
24+
# Setup environment
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
- name: Set up build tools
28+
uses: ./.github/actions/setup-tools
29+
with:
30+
publish-caches: true
31+
# Update product releases (gradle/productsReleases.txt)
32+
- name: Update product releases
33+
run: ./gradlew --stacktrace updateProductsReleases
34+
# Prepare job output
35+
- name: Add resolved product releases to job summary
36+
run: |
37+
cat << EOF >> "$GITHUB_STEP_SUMMARY"
38+
### Product Releases
39+
40+
\`\`\`
41+
$(cat gradle/productsReleases.txt)
42+
\`\`\`
43+
44+
EOF
45+
- name: Check diff
46+
id: diff
47+
run: |
48+
diff_text=$(git diff)
49+
if [ -z "$diff_text" ]; then
50+
echo "has-changes=" >> "$GITHUB_OUTPUT"
51+
diff_text='No changes. File at `gradle/productsReleases.txt` is up-to-date.'
52+
else
53+
echo "has-changes=true" >> "$GITHUB_OUTPUT"
54+
diff_text=$'```diff\n'"$diff_text"$'\n```'
55+
fi
56+
57+
cat << EOF >> "$GITHUB_STEP_SUMMARY"
58+
### Difference
59+
60+
${diff_text}
61+
62+
### Gradle Summary
63+
64+
EOF
65+
- name: Read productsReleases.txt for compatibility testing matrix
66+
id: get-new-products-releases
67+
run: echo "products-releases=$(jq -Rnc '[inputs]' < gradle/productsReleases.txt)" >> "$GITHUB_OUTPUT"
68+
# Upload new product releases
69+
- name: Upload new product releases
70+
id: upload
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: products-releases
74+
path: gradle/productsReleases.txt
75+
if-no-files-found: error
76+
# Build the project to populate the build caches, and
77+
# to verify that the build is working.
78+
- name: Build project
79+
run: ./gradlew --stacktrace assemble buildPlugin verifyPluginStructure check
80+
81+
check-compatibility:
82+
83+
uses: ./.github/workflows/check-compatibility.yml
84+
needs: update-products-releases
85+
with:
86+
products_releases: ${{ needs.update-products-releases.outputs.products-releases }}
87+
88+
push-to-repository:
89+
90+
name: Push Updated Files To Repository
91+
runs-on: ubuntu-latest
92+
needs: [ update-products-releases, check-compatibility ]
93+
if: ${{ inputs.update_repo && needs.update-products-releases.outputs.has-changed }}
94+
95+
steps:
96+
- name: Checkout repository
97+
uses: actions/checkout@v4
98+
- name: Download new product releases
99+
uses: actions/download-artifact@v4
100+
with:
101+
artifact-ids: ${{ needs.update-products-releases.outputs.artifact-id }}
102+
path: gradle/
103+
merge-multiple: true
104+
- name: Commit and push changes
105+
uses: ./.github/actions/commit-and-push
106+
with:
107+
message: Update IDEA releases for testing compatibility
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Test Plugin Compatibility
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
products_releases:
7+
description: 'JSON list of releases to test'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
check-compatibility:
13+
14+
name: Test Plugin Compatibility (${{ matrix.idea-release }})
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
idea-release: ${{ fromJSON(inputs.products_releases) }}
21+
22+
steps:
23+
# Setup environment
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
- name: Set up build tools
27+
uses: ./.github/actions/setup-tools
28+
# Setup caches for Plugin Verifier
29+
- name: Set up cache for IntelliJ Plugin Verifier
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.cache/pluginVerifier/ides
33+
key: pluginVerifier-${{ matrix.idea-release }}-${{ runner.os }}
34+
# Run checks
35+
- name: Check plugin compatibility
36+
run: ./gradlew --stacktrace -PverifierIdeVersionOverride="${{ matrix.idea-release }}" verifyPlugin
37+
# Upload artifacts
38+
- name: Upload build reports
39+
if: always()
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: compatibility-reports-${{ matrix.idea-release }}
43+
path: build/reports/
44+
if-no-files-found: ignore

0 commit comments

Comments
 (0)