Skip to content

Commit 2606633

Browse files
committed
IJMP-1844 Added test and verify to build
Signed-off-by: Uladzislau <leksilonchikk@gmail.com>
1 parent a6d5e4c commit 2606633

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/workflows/build.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,80 @@ jobs:
4444
with:
4545
name: ${{ steps.artifact.outputs.filename }}
4646
path: ./build/distributions/content/*/*
47+
test:
48+
needs: [build]
49+
runs-on: ubuntu-latest
50+
steps:
51+
52+
- name: Checkout the plugin GitHub repository
53+
uses: actions/checkout@v4
54+
55+
- name: Setup Java
56+
uses: actions/setup-java@v4
57+
with:
58+
distribution: zulu
59+
java-version: 17
60+
61+
- name: Setup Gradle
62+
uses: gradle/actions/setup-gradle@v3
63+
with:
64+
gradle-home-cache-cleanup: true
65+
66+
- name: Run tests
67+
shell: bash
68+
run: ./gradlew test
69+
70+
- name: Publish tests result to artifacts
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: tests-report
74+
path: ${{ github.workspace }}/build/reports/tests
75+
76+
- name: Publish code coverage report to artifacts
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: code-coverage-report
80+
path: ${{ github.workspace }}/build/reports/kover/html
81+
82+
verify:
83+
if: ${{ contains(github.ref, 'refs/heads/release/') }}
84+
needs: [build]
85+
runs-on: ubuntu-latest
86+
steps:
87+
88+
- name: Maximize Build Space
89+
uses: jlumbroso/free-disk-space@main
90+
with:
91+
tool-cache: false
92+
large-packages: false
93+
94+
- name: Checkout the plugin GitHub repository
95+
uses: actions/checkout@v4
96+
97+
- name: Setup Java
98+
uses: actions/setup-java@v4
99+
with:
100+
distribution: zulu
101+
java-version: 17
102+
103+
- name: Setup Gradle
104+
uses: gradle/actions/setup-gradle@v3
105+
with:
106+
gradle-home-cache-cleanup: true
107+
108+
- name: Setup Plugin Verifier IDEs Cache
109+
uses: actions/cache@v4
110+
with:
111+
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
112+
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
113+
114+
- name: Verify plugin against IntelliJ IDEA IDE's
115+
continue-on-error: true
116+
shell: bash
117+
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
118+
119+
- name: Collect Plugin Verifier Result
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: plugin-verifier-report
123+
path: ${{ github.workspace }}/build/reports/pluginVerifier

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import java.time.ZoneId
1414
import java.time.format.DateTimeFormatter
1515

1616
fun properties(key: String) = providers.gradleProperty(key)
17+
fun environment(key: String) = providers.environmentVariable(key)
1718
fun dateValue(pattern: String): String =
1819
LocalDate.now(ZoneId.of("Europe/Warsaw")).format(DateTimeFormatter.ofPattern(pattern))
1920

0 commit comments

Comments
 (0)