Skip to content

Commit f092097

Browse files
committed
Add CI job for module
1 parent b41e7b1 commit f092097

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,41 @@ jobs:
4040
name: reports
4141
path: ./**/target/surefire-reports
4242

43+
test-module:
44+
if: contains(github.event.head_commit.message, '[skip ci]') == false
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 30
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
51+
- name: Set up JDK ${{ matrix.java }}
52+
uses: actions/setup-java@v2
53+
with:
54+
distribution: zulu
55+
java-version: 17
56+
cache: maven
57+
58+
- name: Grant execute permission for mvnw
59+
run: chmod +x mvnw
60+
61+
- name: Copy module-info.java
62+
run: cp doma-spring-boot-core/src/module/java/module-info.java doma-spring-boot-core/src/main/java/ && cp doma-spring-boot-autoconfigure/src/module/java/module-info.java doma-spring-boot-autoconfigure/src/main/java/
63+
64+
- name: Test with Maven
65+
run: ./mvnw test -B -Dspring-boot.version=2.5.6 -pl doma-spring-boot-core,doma-spring-boot-autoconfigure
66+
67+
- name: Upload reports
68+
if: failure()
69+
uses: actions/upload-artifact@v2
70+
with:
71+
name: reports
72+
path: ./**/target/surefire-reports
73+
4374
deploy:
4475
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[skip ci]') == false
4576
runs-on: ubuntu-latest
46-
needs: [ test ]
77+
needs: [ test, test-module ]
4778

4879
steps:
4980
- uses: actions/checkout@v2
@@ -53,17 +84,11 @@ jobs:
5384
with:
5485
distribution: zulu
5586
java-version: 8
87+
cache: maven
5688

5789
- name: Grant execute permission for mvnw
5890
run: chmod +x mvnw
5991

60-
- name: Cache Maven packages
61-
uses: actions/cache@v2
62-
with:
63-
path: ~/.m2
64-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
65-
restore-keys: ${{ runner.os }}-m2
66-
6792
- name: Release Maven package
6893
uses: samuelmeuli/action-maven-publish@v1
6994
with:

0 commit comments

Comments
 (0)