-
Notifications
You must be signed in to change notification settings - Fork 15
121 lines (119 loc) · 5.25 KB
/
workflow-3.x.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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