-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
GangCheng
committed
Jan 13, 2024
1 parent
4d029a1
commit 4dee1cf
Showing
4 changed files
with
196 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and Test With Maven [2.x] | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
databaseType: | ||
type: choice | ||
required: true | ||
options: | ||
- MySQL | ||
- Mariadb | ||
- MSSQL | ||
- PostgreSQL | ||
- Oracle | ||
- All | ||
- None | ||
|
||
jobs: | ||
maven-build: | ||
concurrency: | ||
group: reactive-mybais-support | ||
cancel-in-progress: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
cache: maven | ||
- name: Build With Maven | ||
run: mvn clean compile package -DskipTests --file pom.xml | ||
- name: Setup Testcontainers Cloud Client | ||
if: ${{ github.event.inputs.databaseType != 'None' }} | ||
uses: atomicjar/testcontainers-cloud-setup-action@v1 | ||
with: | ||
token: ${{ secrets.TC_CLOUD_TOKEN }} | ||
- name: Run Tests With MySQLContainer | ||
if: ${{ contains(fromJSON('["All", "MySQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MySQLContainer" test | ||
- name: Run Tests With MariaDBContainer | ||
if: ${{ contains(fromJSON('["All", "Mariadb"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MariaDBContainer" test | ||
- name: Run Tests With PostgreSQLContainer | ||
if: ${{ contains(fromJSON('["All", "PostgreSQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=PostgreSQLContainer" test | ||
- name: Run Tests With MSSQLServerContainer | ||
if: ${{ contains(fromJSON('["All", "MSSQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MSSQLServerContainer" test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: Build and Test With Maven [3.x] | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
databaseType: | ||
type: choice | ||
required: true | ||
options: | ||
- MySQL | ||
- Mariadb | ||
- MSSQL | ||
- PostgreSQL | ||
- Oracle | ||
- All | ||
- None | ||
|
||
jobs: | ||
maven-build: | ||
concurrency: | ||
group: reactive-mybais-support | ||
cancel-in-progress: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Toolchain JDK 11 | ||
uses: renatoathaydes/[email protected] | ||
with: | ||
java-version: 11.0.21-tem | ||
- name: Set up Toolchain With JDK 11 | ||
shell: bash | ||
run: | | ||
mkdir -p $HOME/.m2 \ | ||
&& cat << EOF > $HOME/.m2/toolchains.xml | ||
<?xml version="1.0" encoding="UTF8"?> | ||
<toolchains> | ||
<toolchain> | ||
<type>jdk</type> | ||
<provides> | ||
<version>11</version> | ||
</provides> | ||
<configuration> | ||
<jdkHome>${{ env.JAVA_HOME }}</jdkHome> | ||
</configuration> | ||
</toolchain> | ||
</toolchains> | ||
EOF | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build mybatis-r2dbc and mybatis-r2dbc-generator | ||
run: mvn clean compile -pl mybatis-r2dbc -pl mybatis-r2dbc-generator -am install -pl mybatis-r2dbc -pl mybatis-r2dbc-generator -am -DskipTests --file pom.xml | ||
- name: Setup Testcontainers Cloud Client | ||
if: ${{ github.event.inputs.databaseType != 'None' }} | ||
uses: atomicjar/testcontainers-cloud-setup-action@v1 | ||
with: | ||
token: ${{ secrets.TC_CLOUD_TOKEN }} | ||
- name: Run [mybatis-r2dbc] Tests With MySQLContainer | ||
if: ${{ contains(fromJSON('["All", "MySQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MySQLContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With MariaDBContainer | ||
if: ${{ contains(fromJSON('["All", "Mariadb"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MariaDBContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With PostgreSQLContainer | ||
if: ${{ contains(fromJSON('["All", "PostgreSQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=PostgreSQLContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With MSSQLServerContainer | ||
if: ${{ contains(fromJSON('["All", "MSSQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MSSQLServerContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With OracleContainer | ||
if: ${{ contains(fromJSON('["All", "Oracle"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=OracleContainer" test -pl mybatis-r2dbc | ||
- name: Install Toolchain JDK 17 | ||
uses: renatoathaydes/[email protected] | ||
with: | ||
java-version: 17.0.9-tem | ||
- name: Set up Toolchain With JDK 17 | ||
shell: bash | ||
run: | | ||
rm -rf $HOME/.m2/toolchains.xml \ | ||
&& cat << EOF > $HOME/.m2/toolchains.xml | ||
<?xml version="1.0" encoding="UTF8"?> | ||
<toolchains> | ||
<toolchain> | ||
<type>jdk</type> | ||
<provides> | ||
<version>17</version> | ||
</provides> | ||
<configuration> | ||
<jdkHome>${{ env.JAVA_HOME }}</jdkHome> | ||
</configuration> | ||
</toolchain> | ||
</toolchains> | ||
EOF | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build mybatis-r2dbc-spring | ||
run: mvn compile -pl mybatis-r2dbc-spring package -pl mybatis-r2dbc-spring -DskipTests --file pom.xml | ||
- name: Run [mybatis-r2dbc-spring] Tests With MySQLContainer | ||
if: ${{ contains(fromJSON('["All", "MySQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MySQLContainer" test -pl mybatis-r2dbc-spring | ||
- name: Run [mybatis-r2dbc-spring] Tests With MariaDBContainer | ||
if: ${{ contains(fromJSON('["All", "Mariadb"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MariaDBContainer" test -pl mybatis-r2dbc-spring | ||
- name: Run [mybatis-r2dbc-spring] Tests With PostgreSQLContainer | ||
if: ${{ contains(fromJSON('["All", "PostgreSQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=PostgreSQLContainer" test -pl mybatis-r2dbc-spring | ||
- name: Run [mybatis-r2dbc-spring] Tests With MSSQLServerContainer | ||
if: ${{ contains(fromJSON('["All", "MSSQL"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=MSSQLServerContainer" test -pl mybatis-r2dbc-spring | ||
- name: Run [mybatis-r2dbc-spring] Tests With OracleContainer | ||
if: ${{ contains(fromJSON('["All", "Oracle"]'), github.event.inputs.databaseType) }} | ||
run: mvn -B -DargLine="-DdatabaseType=OracleContainer" test -pl mybatis-r2dbc-spring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Java CI with Maven | ||
name: Build and Test With Maven | ||
|
||
on: | ||
push: | ||
branches: [ 3.x,feature/3.* ] | ||
pull_request: | ||
branches: [ 3.x,feature/3.* ] | ||
workflow_dispatch: | ||
inputs: | ||
databaseType: | ||
type: choice | ||
required: true | ||
options: | ||
- MySQL | ||
- Mariadb | ||
- MSSQL | ||
- PostgreSQL | ||
- Oracle | ||
- All | ||
- None | ||
|
||
jobs: | ||
maven-build: | ||
|
@@ -52,14 +61,19 @@ jobs: | |
with: | ||
token: ${{ secrets.TC_CLOUD_TOKEN }} | ||
- name: Run [mybatis-r2dbc] Tests With MySQLContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'MySQL' | ||
run: mvn clean compile -pl mybatis-r2dbc -B -DargLine="-DdatabaseType=MySQLContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With MariaDBContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'Mariadb' | ||
run: mvn clean compile -pl mybatis-r2dbc -B -DargLine="-DdatabaseType=MariaDBContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With PostgreSQLContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'PostgreSQL' | ||
run: mvn clean compile -pl mybatis-r2dbc -B -DargLine="-DdatabaseType=PostgreSQLContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With MSSQLServerContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'MSSQL' | ||
run: mvn clean compile -pl mybatis-r2dbc -B -DargLine="-DdatabaseType=MSSQLServerContainer" test -pl mybatis-r2dbc | ||
- name: Run [mybatis-r2dbc] Tests With OracleContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'Oracle' | ||
run: mvn clean compile -pl mybatis-r2dbc -B -DargLine="-DdatabaseType=OracleContainer" test -pl mybatis-r2dbc | ||
- name: Install Toolchain JDK 17 | ||
uses: renatoathaydes/[email protected] | ||
|
@@ -92,12 +106,17 @@ jobs: | |
- name: Build mybatis-r2dbc-spring | ||
run: mvn clean package -pl mybatis-r2dbc-spring -am -pl mybatis-r2dbc-spring -am -DskipTests --file pom.xml | ||
- name: Run [mybatis-r2dbc-spring] Tests With MySQLContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'MySQL' | ||
run: mvn clean compile -pl mybatis-r2dbc-spring -am -B -DargLine="-DdatabaseType=MySQLContainer" test -pl mybatis-r2dbc-spring -am | ||
- name: Run [mybatis-r2dbc-spring] Tests With MariaDBContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'Mariadb' | ||
run: mvn clean compile -pl mybatis-r2dbc-spring -am -B -DargLine="-DdatabaseType=MariaDBContainer" test -pl mybatis-r2dbc-spring -am | ||
- name: Run [mybatis-r2dbc-spring] Tests With PostgreSQLContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'PostgreSQL' | ||
run: mvn clean compile -pl mybatis-r2dbc-spring -am -B -DargLine="-DdatabaseType=PostgreSQLContainer" test -pl mybatis-r2dbc-spring -am | ||
- name: Run [mybatis-r2dbc-spring] Tests With MSSQLServerContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'MSSQL' | ||
run: mvn clean compile -pl mybatis-r2dbc-spring -am -B -DargLine="-DdatabaseType=MSSQLServerContainer" test -pl mybatis-r2dbc-spring -am | ||
- name: Run [mybatis-r2dbc-spring] Tests With OracleContainer | ||
if: ${{github.event.inputs.databaseType}} == 'All' || ${{github.event.inputs.databaseType}} == 'Oracle' | ||
run: mvn clean compile -pl mybatis-r2dbc-spring -am -B -DargLine="-DdatabaseType=OracleContainer" test -pl mybatis-r2dbc-spring -am |