Skip to content

Commit e65ae15

Browse files
Adds SPI test to CI and also adds local maven cache for jobs
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
1 parent 3c89602 commit e65ae15

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/ci.yml

+74
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ jobs:
5050
./gradlew :opensearch-security-common:publishToMavenLocal -Dbuild.snapshot=false
5151
./gradlew :opensearch-security-client:publishToMavenLocal -Dbuild.snapshot=false
5252
53+
- name: Cache artifacts for dependent jobs
54+
uses: actions/cache@v4.2.2
55+
with:
56+
path: ~/.m2/repository
57+
key: maven-local-${{ github.run_id }}
58+
restore-keys: |
59+
maven-local-
60+
5361
test:
5462
name: test
5563
needs: [generate-test-list, publish-components-to-maven-local]
@@ -71,6 +79,14 @@ jobs:
7179
- name: Checkout security
7280
uses: actions/checkout@v4
7381

82+
- name: Restore Maven Local Cache
83+
uses: actions/cache@v4.2.2
84+
with:
85+
path: ~/.m2/repository
86+
key: maven-local-${{ github.run_id }}
87+
restore-keys: |
88+
maven-local-
89+
7490
- name: Build and Test
7591
uses: gradle/gradle-build-action@v3
7692
with:
@@ -129,6 +145,14 @@ jobs:
129145
- name: Checkout security
130146
uses: actions/checkout@v4
131147

148+
- name: Restore Maven Local Cache
149+
uses: actions/cache@v4.2.2
150+
with:
151+
path: ~/.m2/repository
152+
key: maven-local-${{ github.run_id }}
153+
restore-keys: |
154+
maven-local-
155+
132156
- name: Run Integration Tests
133157
uses: gradle/gradle-build-action@v3
134158
with:
@@ -150,6 +174,48 @@ jobs:
150174
path: |
151175
./build/reports/
152176
177+
spi-tests:
178+
name: spi-tests
179+
needs: publish-components-to-maven-local
180+
strategy:
181+
fail-fast: false
182+
matrix:
183+
jdk: [21]
184+
platform: [ubuntu-latest, windows-latest]
185+
runs-on: ${{ matrix.platform }}
186+
187+
steps:
188+
- name: Set up JDK for build and test
189+
uses: actions/setup-java@v4
190+
with:
191+
distribution: temurin # Temurin is a distribution of adoptium
192+
java-version: ${{ matrix.jdk }}
193+
194+
- name: Checkout security
195+
uses: actions/checkout@v4
196+
197+
- name: Restore Maven Local Cache
198+
uses: actions/cache@v4.2.2
199+
with:
200+
path: ~/.m2/repository
201+
key: maven-local-${{ github.run_id }}
202+
restore-keys: |
203+
maven-local-
204+
205+
- name: Run SPI Tests
206+
uses: gradle/gradle-build-action@v3
207+
with:
208+
cache-disabled: true
209+
arguments: |
210+
:opensearch-resource-sharing-spi:tests -Dbuild.snapshot=false
211+
212+
- uses: actions/upload-artifact@v4
213+
if: always()
214+
with:
215+
name: spi-${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports
216+
path: |
217+
./build/reports/
218+
153219
resource-tests:
154220
env:
155221
CI_ENVIRONMENT: resource-test
@@ -171,6 +237,14 @@ jobs:
171237
- name: Checkout security
172238
uses: actions/checkout@v4
173239

240+
- name: Restore Maven Local Cache
241+
uses: actions/cache@v4.2.2
242+
with:
243+
path: ~/.m2/repository
244+
key: maven-local-${{ github.run_id }}
245+
restore-keys: |
246+
maven-local-
247+
174248
- name: Run Resource Tests
175249
uses: gradle/gradle-build-action@v3
176250
with:

0 commit comments

Comments
 (0)