Skip to content

Commit 9273d69

Browse files
committed
Add check-samples-maven.yml for checking samples
See #300 Signed-off-by: onobc <[email protected]>
1 parent 0ad6133 commit 9273d69

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

.github/workflows/check-samples.yml renamed to .github/workflows/check-samples-gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check Samples (Spring Boot compatability)
1+
name: Check Samples (Gradle)
22

33
on:
44
workflow_dispatch:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Check Samples (Maven)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
check_samples:
8+
name: Check Samples project
9+
if: ${{ github.repository == 'spring-projects/spring-grpc' }}
10+
strategy:
11+
matrix:
12+
include:
13+
- javaVersion: 25
14+
distribution: 'liberica'
15+
- javaVersion: 17
16+
distribution: 'temurin'
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Java ${{ matrix.javaVersion }} ${{ matrix.distribution }}
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: ${{ matrix.javaVersion }}
24+
distribution: ${{ matrix.distribution }}
25+
cache: maven
26+
27+
- name: Build and run samples w/ Java 25 ${{ matrix.distribution }}
28+
if: ${{ matrix.javaVersion == 25 }}
29+
run: |
30+
cd samples
31+
../mvnw clean install \
32+
-pl '!grpc-server-kotlin' \
33+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle \
34+
-Djava.version=25
35+
../mvnw clean install \
36+
-pl 'grpc-server-kotlin' \
37+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle \
38+
-Djava.version=24
39+
40+
- name: Build and run samples w/ Java ${{ matrix.javaVersion }} ${{ matrix.distribution }}
41+
if: ${{ matrix.javaVersion != 25 }}
42+
run: |
43+
cd samples
44+
../mvnw clean install \
45+
-Dmaven-checkstyle-plugin.config.location=../src/checkstyle \
46+
-Djava.version=${{ matrix.javaVersion }}
47+
48+
- name: Upload Build Reports (Java ${{ matrix.javaVersion }} ${{ matrix.distribution }})
49+
if: failure()
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: test-results
53+
path: '*/target/surefire-reports/*.*'
54+
retention-days: 3

0 commit comments

Comments
 (0)