Skip to content

Commit

Permalink
Run CI build on JDK 11 but compatitable with 8 (#23550)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhfeng authored Jan 29, 2023
1 parent c470392 commit 41a417e
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 25 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
java-version: [ 8, 19 ]
java-version: [ 11, 19 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand All @@ -78,6 +78,13 @@ jobs:
run: ./mvnw -T1C -B -ntp clean install
- name: Build examples with Maven
run: ./mvnw -T1C -B -f examples/pom.xml clean package -DskipTests
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run tests with JDK 8
run: ./mvnw -T1C -B -ntp -fae test

test-coverage:
if: github.repository == 'apache/shardingsphere'
Expand All @@ -93,10 +100,17 @@ jobs:
restore-keys: |
${{ env.REPOSITORY_NAME }}-maven-third-party-
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Build with Maven
run: ./mvnw -T1C -B -ntp clean install -DskipTests
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Test with Maven
run: ./mvnw -T1C -B -ntp clean install cobertura:cobertura -Djacoco.skip=false
run: ./mvnw -T1C -B -ntp test cobertura:cobertura -Djacoco.skip=false
- name: Upload to Codecov
run: bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Set environment
run: export MAVEN_OPTS=' -Dmaven.javadoc.skip=true -Djacoco.skip=true $MAVEN_OPTS'
- name: Build docker image
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/e2e-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
java-version: '11'
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand All @@ -80,6 +80,11 @@ jobs:
- name: Build Project
run: |
./mvnw -B clean install -DskipITs -DskipTests -Prelease
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run E2E Test
run: |
./mvnw -B clean install -f test/e2e/agent/plugins/tracing/${{ matrix.plugin }}/pom.xml -Dspotless.apply.skip=true -Pit.env.${{ matrix.plugin }}
Expand All @@ -105,6 +110,11 @@ jobs:
- name: Build Project
run: |
./mvnw -B clean install -DskipITs -DskipTests -Prelease
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run E2E Test
run: |
./mvnw -B clean install -f test/e2e/agent/plugins/metrics/${{ matrix.plugin }}/pom.xml -Dspotless.apply.skip=true -Pit.env.${{ matrix.plugin }}
9 changes: 7 additions & 2 deletions .github/workflows/e2e-discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,17 @@ jobs:
restore-keys: |
${{ env.REPOSITORY_NAME }}-maven-third-party-it-cache
${{ env.REPOSITORY_NAME }}-maven-third-party-
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Build Discovery IT image
run: ./mvnw -B clean install -am -pl test/e2e/discovery -Pit.env.docker -DskipTests
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run MySQL Discovery E2E Test
run: ./mvnw -nsu -B install -f test/e2e/discovery/pom.xml -Dit.env.type=docker -Dit.docker.mysql.version=mysql:5.7
18 changes: 14 additions & 4 deletions .github/workflows/e2e-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,18 @@ jobs:
restore-keys: |
${{ env.REPOSITORY_NAME }}-maven-third-party-it-cache-
${{ env.REPOSITORY_NAME }}-maven-third-party-
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Build Pipeline IT image
run: ./mvnw -B clean install -am -pl test/e2e/pipeline -Pit.env.docker -DskipTests
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run Pipeline MySQL E2E Test
run: ./mvnw -nsu -B install -f test/e2e/pipeline/pom.xml -Dpipeline.it.env.type=docker -Dpipeline.it.docker.mysql.version=${{ env.mysql_version }}
- name: Run Pipeline PostgreSQL E2E Test
Expand All @@ -123,13 +128,18 @@ jobs:
restore-keys: |
${{ env.REPOSITORY_NAME }}-maven-third-party-it-cache-
${{ env.REPOSITORY_NAME }}-maven-third-party-
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Build Pipeline IT image
run: ./mvnw -B clean install -am -pl test/e2e/pipeline -Pit.env.docker -DskipTests
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run Pipeline Daily MySQL E2E Test
run: ./mvnw -nsu -B install -f test/e2e/pipeline/pom.xml -Dpipeline.it.env.type=docker -Dpipeline.it.docker.mysql.version=${{ env.mysql_version }}
- name: Run Pipeline Daily PostgreSQL E2E Test
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/e2e-showprocesslist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,17 @@ jobs:
restore-keys: |
${{ env.REPOSITORY_NAME }}-maven-third-party-it-cache
${{ env.REPOSITORY_NAME }}-maven-third-party-
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Build ShowProcesslist IT image
run: ./mvnw -B clean install -am -pl test/e2e/showprocesslist -Pit.env.docker -DskipTests
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run MySQL ShowProcesslist E2E Test
run: ./mvnw -nsu -B install -f test/e2e/showprocesslist/pom.xml -Dit.env.type=docker -Dit.scenarios=cluster_jdbc_proxy -Dit.run.modes=${{ matrix.mode }}
9 changes: 7 additions & 2 deletions .github/workflows/e2e-transaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ jobs:
restore-keys: |
${{ env.REPOSITORY_NAME }}-maven-third-party-it-cache
${{ env.REPOSITORY_NAME }}-maven-third-party-
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Build Transaction IT image
run: ./mvnw -B clean install -am -pl test/e2e/transaction -Pit.env.docker -DskipTests
- name: Setup JDK 8 for Test
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Run MySQL Transaction E2E Test
run: ./mvnw -nsu -B install -f test/e2e/transaction/pom.xml -Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=LOCAL,XA -Dtransaction.it.env.xa.providers=Atomikos,Narayana -Dtransaction.it.docker.mysql.version=${{ env.mysql_version }}
- name: Run PostgreSQL Transaction E2E Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
java-version: '11'
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-build-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Build project
run: |
./mvnw -B clean install -Prelease
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Cache Maven Repos
uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-build-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
java-version: '11'
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
java-version: '11'
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
java-version: [ 8, 17, 19 ]
java-version: [ 11, 17, 19 ]
steps:
- name: Support long paths in Windows
if: matrix.os == 'windows-latest'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
java-version: '11'
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Download IT image
if: matrix.adapter == 'proxy'
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Download IT image
if: matrix.adapter == 'proxy'
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11
- name: Download IT image
if: matrix.adapter == 'proxy'
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-sql-parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [ 8 ]
java-version: [ 11 ]
database: [ mysql, postgresql ]
steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,9 @@
<activation>
<jdk>[11,)</jdk>
</activation>
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
<build>
<pluginManagement>
<plugins>
Expand Down

0 comments on commit 41a417e

Please sign in to comment.