Skip to content

Commit 7a6ff04

Browse files
authored
Include integration-test projects (aka. domaframework/doma-it) into this repository (#750)
* Include integration-test projects * Simplify CI workflow * Change the job name * Create module-info.java in early phase * Disable the Gradle Daemon * Change the step name * Avoid kapt related error * Format * Revert "Disable the Gradle Daemon" This reverts commit 3d076a3. * Publish only when the event name is 'push' * Test with/without JPMS * Simplify CI test * Introduce gradle/gradle-build-action * Remove an unused matrix variable * Change timeout-minutes * Add javaToolchains task * Change the step name * Change the report name
1 parent 7671a5e commit 7a6ff04

File tree

263 files changed

+14929
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+14929
-112
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ on:
99

1010
jobs:
1111
build:
12-
if: contains(github.event.head_commit.message, '[skip build]') == false
13-
name: Build And Install
12+
name: Build
1413
runs-on: ubuntu-latest
15-
timeout-minutes: 30
16-
outputs:
17-
version: ${{ steps.set-version.outputs.version }}
14+
timeout-minutes: 15
1815

1916
steps:
2017
- name: Set up JDK 8
@@ -27,47 +24,19 @@ jobs:
2724
shell: bash
2825
run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV
2926

30-
- name: Set up JDK 11
27+
- name: Set up JDK 17
3128
uses: actions/setup-java@v2
3229
with:
3330
distribution: 'zulu'
34-
java-version: 11
31+
java-version: 17
3532

3633
- name: Checkout
3734
uses: actions/checkout@v2
3835

39-
- name: Grant execute permission for gradlew
40-
run: chmod +x gradlew
41-
42-
- name: Cache Gradle
43-
uses: actions/cache@v2
44-
with:
45-
path: |
46-
~/.gradle/caches
47-
~/.gradle/wrapper
48-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
49-
restore-keys: |
50-
${{ runner.os }}-gradle-
51-
52-
- name: Set version
53-
id: set-version
54-
run: ./gradlew properties | grep "^version:" | awk '{print $2}' | { read v; echo "::set-output name=version::$v"; }
55-
56-
- name: Print version
57-
run: echo ${{ steps.set-version.outputs.version }}
58-
59-
- name: Build and Install packages
60-
run: ./gradlew assemble check publishToMavenLocal -x signMavenPublication
61-
62-
- name: Tar Maven Repository
63-
shell: bash
64-
run: tar -czf maven-repository.tgz -C ~ .m2/repository
65-
66-
- name: Persist Maven Repository
67-
uses: actions/upload-artifact@v2
36+
- name: Assemble and Check
37+
uses: gradle/gradle-build-action@v2
6838
with:
69-
name: maven-repository
70-
path: maven-repository.tgz
39+
arguments: javaToolchains assemble check
7140

7241
- name: Upload reports
7342
if: failure()
@@ -77,96 +46,97 @@ jobs:
7746
path: ./**/build/reports
7847

7948
test:
80-
name: Test (Java${{ matrix.java }}, ${{ matrix.driver }})
49+
name: Test (${{ matrix.driver }})
8150
runs-on: ubuntu-latest
82-
needs: build
8351
strategy:
8452
matrix:
85-
java: [8, 17]
8653
driver: [h2, mysql, postgresql, sqlserver]
87-
timeout-minutes: 10
54+
timeout-minutes: 15
8855

8956
steps:
90-
- name: Download Maven Repository
91-
uses: actions/download-artifact@v2
57+
- name: Set up JDK 8
58+
uses: actions/setup-java@v2
9259
with:
93-
name: maven-repository
94-
path: .
60+
distribution: 'zulu'
61+
java-version: 8
9562

96-
- name: Extract Maven Repository
63+
- name: Prepare JDK8 env var
9764
shell: bash
98-
run: tar -xzf maven-repository.tgz -C ~
65+
run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV
9966

100-
- name: Set up JDK ${{ matrix.java }}
67+
- name: Set up JDK 17
10168
uses: actions/setup-java@v2
10269
with:
10370
distribution: 'zulu'
104-
java-version: ${{ matrix.java }}
71+
java-version: 17
10572

10673
- name: Checkout
10774
uses: actions/checkout@v2
108-
with:
109-
repository: domaframework/doma-it
110-
111-
- name: Grant execute permission for gradlew
112-
run: chmod +x gradlew
11375

114-
- name: Cache Gradle
115-
uses: actions/cache@v2
76+
- name: Test with Java 8
77+
uses: gradle/gradle-build-action@v2
11678
with:
117-
path: |
118-
~/.gradle/caches
119-
~/.gradle/wrapper
120-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
121-
restore-keys: |
122-
${{ runner.os }}-gradle-
123-
124-
- name: Test
125-
run: ./gradlew ${{ matrix.driver }} -PdomaVersion=${{ needs.build.outputs.version }} -PenableAdditionalFeatures=true
126-
79+
arguments: |
80+
-Pdriver=${{ matrix.driver }}
81+
-PtestJavaLangVersion=8
82+
javaToolchains
83+
integration-test-java:test
84+
integration-test-kotlin:test
85+
86+
- name: Test with Java 17 using JPMS
87+
uses: gradle/gradle-build-action@v2
88+
with:
89+
arguments: |
90+
-Pdriver=${{ matrix.driver }}
91+
-PtestJavaLangVersion=17
92+
-PtestUseModule=true
93+
javaToolchains
94+
integration-test-java:test
95+
integration-test-java-latest:test
96+
12797
- name: Upload reports
12898
if: failure()
12999
uses: actions/upload-artifact@v2
130100
with:
131-
name: java${{ matrix.java }}-${{ matrix.driver }}
101+
name: test-${{ matrix.driver }}
132102
path: ./**/build/reports
133103

134104
publish:
135-
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[skip build]') == false
105+
if: github.event_name == 'push'
136106
name: Publish
137107
runs-on: ubuntu-latest
138108
needs: [ build, test ]
109+
timeout-minutes: 30
139110

140111
steps:
141-
- name: Set up JDK 11
112+
- name: Set up JDK 8
142113
uses: actions/setup-java@v2
143114
with:
144115
distribution: 'zulu'
145-
java-version: 11
146-
147-
- name: Checkout
148-
uses: actions/checkout@v2
116+
java-version: 8
149117

150-
- name: Grant execute permission for gradlew
151-
run: chmod +x gradlew
118+
- name: Prepare JDK8 env var
119+
shell: bash
120+
run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV
152121

153-
- name: Cache Gradle
154-
uses: actions/cache@v2
122+
- name: Set up JDK 17
123+
uses: actions/setup-java@v2
155124
with:
156-
path: |
157-
~/.gradle/caches
158-
~/.gradle/wrapper
159-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
160-
restore-keys: |
161-
${{ runner.os }}-gradle-
125+
distribution: 'zulu'
126+
java-version: 17
127+
128+
- name: Checkout
129+
uses: actions/checkout@v2
162130

163131
- name: Publish packages
164-
run: ./gradlew publish closeAndReleaseRepository
132+
uses: gradle/gradle-build-action@v2
165133
env:
166134
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
167135
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
168136
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
169137
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
138+
with:
139+
arguments: javaToolchains publish closeAndReleaseRepository
170140

171141
- name: Upload reports
172142
if: failure()

0 commit comments

Comments
 (0)