@@ -16,7 +16,7 @@ name: Build
1616on :
1717 # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
1818 push :
19- branches : [main]
19+ branches : [ main ]
2020 # Trigger the workflow on any pull request
2121 pull_request :
2222
3131 outputs :
3232 version : ${{ steps.properties.outputs.version }}
3333 changelog : ${{ steps.properties.outputs.changelog }}
34+ pluginVerifierHomeDir : ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3435 steps :
3536 - name : Maximize Build Space
3637 run : |
5354 distribution : zulu
5455 java-version : 17
5556
57+ - name : Setup Gradle
58+ uses : gradle/gradle-build-action@v2
59+
5660 # Set environment variables
5761 - name : Export Properties
5862 id : properties
7175 echo "$CHANGELOG" >> $GITHUB_OUTPUT
7276 echo "EOF" >> $GITHUB_OUTPUT
7377 ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
78+ # Build plugin
79+ - name : Build plugin
80+ run : ./gradlew buildPlugin
81+
82+ # Prepare plugin archive content for creating artifact
83+ - name : Prepare Plugin Artifact
84+ id : artifact
85+ shell : bash
86+ run : |
87+ cd ${{ github.workspace }}/build/distributions
88+ FILENAME=`ls *.zip`
89+ unzip "$FILENAME" -d content
90+ echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
91+ # Store already-built plugin as an artifact for downloading
92+ - name : Upload artifact
93+ uses : actions/upload-artifact@v3
94+ with :
95+ name : ${{ steps.artifact.outputs.filename }}
96+ path : ./build/distributions/content/*/*
97+
98+ # Run tests and upload a code coverage report
99+ test :
100+ name : Test
101+ needs : [ build ]
102+ runs-on : ubuntu-latest
103+ steps :
104+
105+ # Check out current repository
106+ - name : Fetch Sources zza
107+ uses : actions/checkout@v3
74108
109+ # Setup Java environment for the next steps
110+ - name : Setup Java
111+ uses : actions/setup-java@v3
112+ with :
113+ distribution : zulu
114+ java-version : 17
115+
116+ # Setup Gradle
117+ - name : Setup Gradle
118+ uses : gradle/gradle-build-action@v2
75119 # Run tests
76120 - name : Run Tests
77121 run : ./gradlew check
@@ -88,16 +132,66 @@ jobs:
88132 uses : codecov/codecov-action@v3
89133 with :
90134 files : ${{ github.workspace }}/build/reports/kover/xml/report.xml
135+ # Run Qodana inspections and provide report
136+ inspectCode :
137+ name : Inspect code
138+ needs : [ build ]
139+ runs-on : ubuntu-latest
140+ permissions :
141+ contents : write
142+ checks : write
143+ pull-requests : write
144+ steps :
145+
146+ # Check out current repository
147+ - name : Fetch Sources
148+ uses : actions/checkout@v3
149+
150+ # Setup Java environment for the next steps
151+ - name : Setup Java
152+ uses : actions/setup-java@v3
153+ with :
154+ distribution : zulu
155+ java-version : 17
156+
157+ # Run Qodana inspections
158+ - name : Qodana - Code Inspection
159+ 160+ with :
161+ cache-default-branch-only : true
162+
163+ # Run plugin structure verification along with IntelliJ Plugin Verifier
164+ verify :
165+ name : Verify plugin
166+ needs : [ build, test, inspectCode ]
167+ runs-on : ubuntu-latest
168+ steps :
169+
170+ # Check out current repository
171+ - name : Fetch Sources
172+ uses : actions/checkout@v3
173+
174+ # Setup Java environment for the next steps
175+ - name : Setup Java
176+ uses : actions/setup-java@v3
177+ with :
178+ distribution : zulu
179+ java-version : 17
180+
181+ # Setup Gradle
182+ - name : Setup Gradle
183+ uses : gradle/gradle-build-action@v2
184+
91185 # Cache Plugin Verifier IDEs
92186 - name : Setup Plugin Verifier IDEs Cache
93187 uses : actions/cache@v3
94188 with :
95- path : ${{ steps.properties .outputs.pluginVerifierHomeDir }}/ides
189+ path : ${{ needs.build .outputs.pluginVerifierHomeDir }}/ides
96190 key : plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
97191
98192 # Run Verify Plugin task and IntelliJ Plugin Verifier tool
99193 - name : Run Plugin Verification tasks
100- run : ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ steps.properties .outputs.pluginVerifierHomeDir }}
194+ run : ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build .outputs.pluginVerifierHomeDir }}
101195
102196 # Collect Plugin Verifier Result
103197 - name : Collect Plugin Verifier Result
@@ -107,34 +201,12 @@ jobs:
107201 name : pluginVerifier-result
108202 path : ${{ github.workspace }}/build/reports/pluginVerifier
109203
110- # Run Qodana inspections
111- - name : Qodana - Code Inspection
112- 113-
114- # Prepare plugin archive content for creating artifact
115- - name : Prepare Plugin Artifact
116- id : artifact
117- shell : bash
118- run : |
119- cd ${{ github.workspace }}/build/distributions
120- FILENAME=`ls *.zip`
121- unzip "$FILENAME" -d content
122-
123- echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
124-
125- # Store already-built plugin as an artifact for downloading
126- - name : Upload artifact
127- uses : actions/upload-artifact@v3
128- with :
129- name : ${{ steps.artifact.outputs.filename }}
130- path : ./build/distributions/content/*/*
131-
132204 # Prepare a draft release for GitHub Releases page for the manual verification
133205 # If accepted and published, release workflow would be triggered
134206 releaseDraft :
135- name : Release Draft
207+ name : Release draft
136208 if : github.event_name != 'pull_request'
137- needs : build
209+ needs : [ build, verify ]
138210 runs-on : ubuntu-latest
139211 permissions :
140212 contents : write
@@ -144,6 +216,13 @@ jobs:
144216 - name : Fetch Sources
145217 uses : actions/checkout@v3
146218
219+ # Setup Java environment for the next steps
220+ - name : Setup Java
221+ uses : actions/setup-java@v3
222+ with :
223+ distribution : zulu
224+ java-version : 17
225+
147226 # Remove old release drafts by using the curl request for the available releases with draft flag
148227 - name : Remove Old Release Drafts
149228 env :
0 commit comments