-
-
Notifications
You must be signed in to change notification settings - Fork 29
110 lines (99 loc) · 3.09 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build
on:
pull_request:
workflow_call:
outputs:
metadata-artifact:
description: The name of the artifact containing the result of the metadata task
value: metadata
build-artifact:
description: The name of the artifact containing the build result
value: build-result
workflow_dispatch:
jobs:
gradle-wrapper-validation:
name: Validate Gradle Wrapper
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
build:
name: Build Plugin
runs-on: ubuntu-latest
needs: gradle-wrapper-validation
outputs:
idea-releases: ${{ steps.metadata.outputs.products-releases }}
steps:
# Setup environment
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up build tools
uses: ./.github/actions/setup-tools
with:
publish-caches: true
# Collect metadata
- name: Collect metadata for upcoming steps and jobs
id: metadata
run: |
./gradlew --stacktrace metadata
echo "products-releases=$(./gradlew -q printProductsReleases | jq -Rnc '[inputs]')" >> "$GITHUB_OUTPUT"
# Build
- name: Build project
run: ./gradlew --stacktrace assemble buildPlugin
- name: Verify plugin
run: ./gradlew --stacktrace verifyPluginStructure
- name: Run linters and tests
run: ./gradlew --stacktrace check
# Upload artifacts
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: build-reports
path: build/reports/
if-no-files-found: ignore
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: build-result
path: build/distributions/
if-no-files-found: error
- name: Upload metadata
uses: actions/upload-artifact@v4
with:
name: metadata
path: build/metadata/
if-no-files-found: error
check-compatibility:
name: Test Plugin Compatibility (${{ matrix.idea-release }})
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
idea-release: ${{ fromJSON(needs.build.outputs.idea-releases) }}
steps:
# Setup environment
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up build tools
uses: ./.github/actions/setup-tools
# Setup caches for Plugin Verifier
- name: Set up cache for IntelliJ Plugin Verifier
uses: actions/cache@v4
with:
path: ~/.cache/pluginVerifier/ides
key: pluginVerifier-${{ matrix.idea-release }}-${{ runner.os }}
# Run checks
- name: Check plugin compatibility
run: ./gradlew --stacktrace -PverifierIdeVersionOverride="${{ matrix.idea-release }}" verifyPlugin
# Upload artifacts
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: compatibility-reports-${{ matrix.idea-release }}
path: build/reports/
if-no-files-found: ignore