11name : Build
2-
32on :
3+ # Trigger the workflow on pushes to only the 'master' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
44 push :
55 branches : [ master ]
6+ # Trigger the workflow on any pull request
67 pull_request :
78
89concurrency :
@@ -11,30 +12,32 @@ concurrency:
1112
1213jobs :
1314
14- # Prepare environment and build the plugin
15+ # Prepare the environment and build the plugin
1516 build :
1617 name : Build
1718 runs-on : ubuntu-latest
1819 outputs :
1920 version : ${{ steps.properties.outputs.version }}
2021 changelog : ${{ steps.properties.outputs.changelog }}
21- pluginVerifierHomeDir : ${{ steps.properties.outputs.pluginVerifierHomeDir }}
2222 steps :
2323
24+ # Free GitHub Actions Environment Disk Space
25+ - name : Maximize Build Space
26+ uses : jlumbroso/free-disk-space@v1.3.1
27+ with :
28+ tool-cache : false
29+ large-packages : false
30+
2431 # Check out the current repository
2532 - name : Fetch Sources
2633 uses : actions/checkout@v4
2734
28- # Validate wrapper
29- - name : Gradle Wrapper Validation
30- uses : gradle/actions/wrapper-validation@v3
31-
32- # Set up Java environment for the next steps
35+ # Set up the Java environment for the next steps
3336 - name : Setup Java
3437 uses : actions/setup-java@v4
3538 with :
3639 distribution : zulu
37- java-version : 17
40+ java-version : 21
3841
3942 # Setup Gradle
4043 - name : Setup Gradle
5053 CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
5154
5255 echo "version=$VERSION" >> $GITHUB_OUTPUT
53- echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
54-
5556 echo "changelog<<EOF" >> $GITHUB_OUTPUT
5657 echo "$CHANGELOG" >> $GITHUB_OUTPUT
5758 echo "EOF" >> $GITHUB_OUTPUT
6061 - name : Build plugin
6162 run : ./gradlew buildPlugin
6263
63- # Run tests
64+ # Run tests and upload a code coverage report
6465 test :
6566 name : Test (${{ matrix.os }})
6667 needs : [ build ]
@@ -74,20 +75,30 @@ jobs:
7475 - macos-latest
7576 steps :
7677
78+ # Free GitHub Actions Environment Disk Space
79+ - name : Maximize Build Space
80+ uses : jlumbroso/free-disk-space@v1.3.1
81+ if : runner.os == 'Linux'
82+ with :
83+ tool-cache : false
84+ large-packages : false
85+
7786 # Check out the current repository
7887 - name : Fetch Sources
7988 uses : actions/checkout@v4
8089
81- # Set up Java environment for the next steps
90+ # Set up the Java environment for the next steps
8291 - name : Setup Java
8392 uses : actions/setup-java@v4
8493 with :
8594 distribution : zulu
86- java-version : 17
95+ java-version : 21
8796
8897 # Setup Gradle
8998 - name : Setup Gradle
9099 uses : gradle/actions/setup-gradle@v4
100+ with :
101+ cache-read-only : true
91102
92103 # Run tests
93104 - name : Run Tests
98109 if : ${{ failure() }}
99110 uses : actions/upload-artifact@v4
100111 with :
101- name : tests-result
112+ name : tests-result-${{ matrix.os }}
102113 path : ${{ github.workspace }}/build/reports/tests
103114
104115 # Run plugin structure verification along with IntelliJ Plugin Verifier
@@ -108,24 +119,33 @@ jobs:
108119 runs-on : ubuntu-latest
109120 steps :
110121
122+ # Free GitHub Actions Environment Disk Space
123+ - name : Maximize Build Space
124+ uses : jlumbroso/free-disk-space@v1.3.1
125+ with :
126+ tool-cache : false
127+ large-packages : false
128+
111129 # Check out the current repository
112130 - name : Fetch Sources
113131 uses : actions/checkout@v4
114132
115- # Set up Java environment for the next steps
133+ # Set up the Java environment for the next steps
116134 - name : Setup Java
117135 uses : actions/setup-java@v4
118136 with :
119137 distribution : zulu
120- java-version : 17
138+ java-version : 21
121139
122140 # Setup Gradle
123141 - name : Setup Gradle
124142 uses : gradle/actions/setup-gradle@v4
143+ with :
144+ cache-read-only : true
125145
126146 # Run Verify Plugin task and IntelliJ Plugin Verifier tool
127147 - name : Run Plugin Verification tasks
128- run : ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
148+ run : ./gradlew verifyPlugin
129149
130150 # Collect Plugin Verifier Result
131151 - name : Collect Plugin Verifier Result
0 commit comments