1
+ # GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
2
+ # - validate Gradle Wrapper,
3
+ # - run 'test' and 'verifyPlugin' tasks,
4
+ # - run Qodana inspections,
5
+ # - run 'buildPlugin' task and prepare artifact for the further tests,
6
+ # - run 'runPluginVerifier' task,
7
+ # - create a draft release.
8
+ #
9
+ # Workflow is triggered on push and pull_request events.
10
+ #
11
+ # GitHub Actions reference: https://help.github.com/en/actions
12
+ #
13
+ # # JBIJPPTPL
14
+
15
+ name : Build on develop
16
+ on :
17
+ # Trigger the workflow on pushes to only the 'develop' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
18
+ push :
19
+ branches : [develop]
20
+ # Trigger the workflow on any pull request
21
+ pull_request :
22
+ branches : [develop]
23
+
24
+ jobs :
25
+
26
+ # Run Gradle Wrapper Validation Action to verify the wrapper's checksum
27
+ # Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
28
+ # Build plugin and provide the artifact for the next workflow jobs
29
+ build :
30
+ name : Build
31
+ runs-on : ubuntu-latest
32
+ outputs :
33
+ version : ${{ steps.properties.outputs.version }}
34
+ changelog : ${{ steps.properties.outputs.changelog }}
35
+ steps :
36
+
37
+ # Free GitHub Actions Environment Disk Space
38
+ - name : Maximize Build Space
39
+ run : |
40
+ sudo rm -rf /usr/share/dotnet
41
+ sudo rm -rf /usr/local/lib/android
42
+ sudo rm -rf /opt/ghc
43
+
44
+ # Check out current repository
45
+ - name : Fetch Sources
46
+ uses : actions/checkout@v3
47
+
48
+ # Validate wrapper
49
+ - name : Gradle Wrapper Validation
50
+
51
+
52
+ # Setup Java 11 environment for the next steps
53
+ - name : Setup Java
54
+ uses : actions/setup-java@v3
55
+ with :
56
+ distribution : zulu
57
+ java-version : 11
58
+
59
+ # Set environment variables
60
+ - name : Export Properties
61
+ id : properties
62
+ shell : bash
63
+ run : |
64
+ PROPERTIES="$(./gradlew properties --console=plain -q)"
65
+ VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
66
+ NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
67
+ CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
68
+
69
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
70
+ echo "name=$NAME" >> $GITHUB_OUTPUT
71
+ echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
72
+
73
+ echo "changelog<<EOF" >> $GITHUB_OUTPUT
74
+ echo "$CHANGELOG" >> $GITHUB_OUTPUT
75
+ echo "EOF" >> $GITHUB_OUTPUT
76
+
77
+ ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
78
+
79
+ # Run tests
80
+ - name : Run Tests
81
+ run : ./gradlew check
82
+
83
+ # Collect Tests Result of failed tests
84
+ - name : Collect Tests Result
85
+ if : ${{ failure() }}
86
+ uses : actions/upload-artifact@v3
87
+ with :
88
+ name : tests-result
89
+ path : ${{ github.workspace }}/build/reports/tests
90
+
91
+ # Upload Kover report to CodeCov
92
+ - name : Upload Code Coverage Report
93
+ uses : codecov/codecov-action@v3
94
+ with :
95
+ files : ${{ github.workspace }}/build/reports/kover/xml/report.xml
0 commit comments