Skip to content

Commit 8a99944

Browse files
committed
Adding PostgreSQL 13 and MySQL 8.3 to GitHub Actions.
1 parent e013f37 commit 8a99944

File tree

1 file changed

+194
-83
lines changed

1 file changed

+194
-83
lines changed

.github/workflows/check.yml

+194-83
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Check
22
on: [ pull_request, push ]
33
jobs:
4-
mysql:
4+
mysql5_7:
55
runs-on: ubuntu-latest
66
# push: always run.
77
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
@@ -13,34 +13,98 @@ jobs:
1313
image: mysql:5.7
1414
options: --health-cmd "mysqladmin ping -h localhost" --health-interval 20s --health-timeout 10s --health-retries 10
1515
ports:
16-
- "3306:3306"
16+
- "3306:3306"
1717
env:
1818
MYSQL_ROOT_PASSWORD: root
1919
MYSQL_USER: ci
2020
MYSQL_PASSWORD: password
2121
steps:
22-
- uses: actions/checkout@v3
23-
- name: Set up JDK 8
24-
uses: actions/setup-java@v3
25-
with:
26-
java-version: 8
27-
distribution: 'temurin'
28-
cache: "gradle"
29-
- name: Connect
30-
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "show databases;"
31-
- name: Create database
32-
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "create database ci_test;"
33-
- name: Build with testing
34-
run: ./gradlew --stacktrace :embulk-output-mysql:check
22+
- uses: actions/checkout@v4
23+
- name: Set up JDK 8
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: 8
27+
distribution: 'zulu'
28+
cache: "gradle"
29+
- name: Connect
30+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "show databases;"
31+
- name: Create database
32+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "create database ci_test;"
33+
- name: Build with testing
34+
run: ./gradlew --stacktrace :embulk-output-mysql:check
35+
env:
36+
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
37+
EMBULK_OUTPUT_MYSQL_TEST_CONFIG: "${{ github.workspace }}/ci/mysql.yml"
38+
- uses: actions/upload-artifact@v4
39+
if: always()
40+
with:
41+
name: mysql5_7
42+
path: embulk-output-mysql/build/reports/tests/test
43+
mysql8_3:
44+
runs-on: ubuntu-latest
45+
# push: always run.
46+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
47+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
48+
strategy:
49+
fail-fast: false
50+
services:
51+
mysql:
52+
# Due to MySQL 8.4 disabled mysql_native_password by default,
53+
# Connector/J 5.x can't connect to database.
54+
# So, Use MySQL 8.3.
55+
image: mysql:8.3
56+
options: --health-cmd "mysqladmin ping -h localhost" --health-interval 20s --health-timeout 10s --health-retries 10
57+
ports:
58+
- "3306:3306"
3559
env:
36-
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
37-
EMBULK_OUTPUT_MYSQL_TEST_CONFIG: "${{ github.workspace }}/ci/mysql.yml"
38-
- uses: actions/upload-artifact@v3
39-
if: always()
40-
with:
41-
name: mysql
42-
path: embulk-output-mysql/build/reports/tests/test
43-
postgresql:
60+
MYSQL_ROOT_PASSWORD: root
61+
MYSQL_USER: ci
62+
MYSQL_PASSWORD: password
63+
steps:
64+
- uses: actions/checkout@v4
65+
- name: Set up JDK 8
66+
uses: actions/setup-java@v4
67+
with:
68+
java-version: 8
69+
distribution: 'zulu'
70+
cache: "gradle"
71+
- name: Connect
72+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "show databases;"
73+
- name: show version
74+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "select version();"
75+
- name: Create database
76+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "create database ci_test;"
77+
#
78+
# MySQL 8 uses caching_sha2_password mechanism by default.
79+
# Connector/J 5.x doesn't support it.
80+
#
81+
# This part change password mechanism to mysql_native_password.
82+
# Remove the following part after update Connector/J
83+
#
84+
- name: Show password plugins
85+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "SELECT user, host, plugin FROM mysql.user;"
86+
- name: Change password mechanism1 (root@localhost)
87+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"
88+
- name: Change password mechanism2 (root@%)
89+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';"
90+
- name: FLUSH PRIVILEGES
91+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "FLUSH PRIVILEGES;"
92+
- name: Show password plugins2
93+
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "SELECT user, host, plugin FROM mysql.user;"
94+
#
95+
# End caching_sha2_password workaround.
96+
#
97+
- name: Build with testing
98+
run: ./gradlew --stacktrace :embulk-output-mysql:check
99+
env:
100+
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
101+
EMBULK_OUTPUT_MYSQL_TEST_CONFIG: "${{ github.workspace }}/ci/mysql.yml"
102+
- uses: actions/upload-artifact@v4
103+
if: always()
104+
with:
105+
name: mysql8_3
106+
path: embulk-output-mysql/build/reports/tests/test
107+
postgresql9_4:
44108
runs-on: ubuntu-latest
45109
# push: always run.
46110
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
@@ -56,31 +120,78 @@ jobs:
56120
env:
57121
POSTGRES_PASSWORD: postgres
58122
steps:
59-
- uses: actions/checkout@v3
60-
- name: Set up JDK 8
61-
uses: actions/setup-java@v3
62-
with:
63-
java-version: 8
64-
distribution: 'temurin'
65-
cache: "gradle"
66-
- name: Connect
67-
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "\l"
68-
env:
69-
PGPASSWORD: postgres
70-
- name: Create database
71-
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "create database ci_test;"
72-
env:
73-
PGPASSWORD: postgres
74-
- name: Build with testing
75-
run: ./gradlew --stacktrace :embulk-output-postgresql:check
123+
- uses: actions/checkout@v4
124+
- name: Set up JDK 8
125+
uses: actions/setup-java@v4
126+
with:
127+
java-version: 8
128+
distribution: 'zulu'
129+
cache: "gradle"
130+
- name: Connect
131+
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "\l"
132+
env:
133+
PGPASSWORD: postgres
134+
- name: Create database
135+
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "create database ci_test;"
136+
env:
137+
PGPASSWORD: postgres
138+
- name: Build with testing
139+
run: ./gradlew --stacktrace :embulk-output-postgresql:check
140+
env:
141+
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
142+
EMBULK_OUTPUT_POSTGRESQL_TEST_CONFIG: "${{ github.workspace }}/ci/postgresql.yml"
143+
- uses: actions/upload-artifact@v4
144+
if: always()
145+
with:
146+
name: postgresql9_4
147+
path: embulk-output-postgresql/build/reports/tests/test
148+
# PostgreSQL 14 and later, raise the exception "The authentication type 10 is not supported."
149+
# Use PostgreSQL 13 at this time.
150+
postgresql13:
151+
runs-on: ubuntu-latest
152+
# push: always run.
153+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
154+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
155+
strategy:
156+
fail-fast: false
157+
services:
158+
postgres:
159+
image: postgres:13
160+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
161+
ports:
162+
- "5432:5432"
76163
env:
77-
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
78-
EMBULK_OUTPUT_POSTGRESQL_TEST_CONFIG: "${{ github.workspace }}/ci/postgresql.yml"
79-
- uses: actions/upload-artifact@v3
80-
if: always()
81-
with:
82-
name: postgresql
83-
path: embulk-output-postgresql/build/reports/tests/test
164+
POSTGRES_PASSWORD: postgres
165+
steps:
166+
- uses: actions/checkout@v4
167+
- name: Set up JDK 8
168+
uses: actions/setup-java@v4
169+
with:
170+
java-version: 8
171+
distribution: 'zulu'
172+
cache: "gradle"
173+
- name: Connect
174+
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "\l"
175+
env:
176+
PGPASSWORD: postgres
177+
- name: Show version
178+
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "select * from version();"
179+
env:
180+
PGPASSWORD: postgres
181+
- name: Create database
182+
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "create database ci_test;"
183+
env:
184+
PGPASSWORD: postgres
185+
- name: Build with testing
186+
run: ./gradlew --stacktrace :embulk-output-postgresql:check
187+
env:
188+
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
189+
EMBULK_OUTPUT_POSTGRESQL_TEST_CONFIG: "${{ github.workspace }}/ci/postgresql.yml"
190+
- uses: actions/upload-artifact@v4
191+
if: always()
192+
with:
193+
name: postgresql13
194+
path: embulk-output-postgresql/build/reports/tests/test
84195
redshift:
85196
runs-on: ubuntu-latest
86197
# push: always run.
@@ -98,46 +209,46 @@ jobs:
98209
env:
99210
POSTGRES_PASSWORD: postgres
100211
steps:
101-
- uses: actions/checkout@v3
102-
- name: Set up JDK 8
103-
uses: actions/setup-java@v3
104-
with:
105-
java-version: 8
106-
distribution: 'temurin'
107-
cache: "gradle"
108-
- name: Connect
109-
run: psql -h 127.0.0.1 -p 5439 -U postgres -d postgres -c "\l"
110-
env:
111-
PGPASSWORD: postgres
112-
- name: Create database
113-
run: psql -h 127.0.0.1 -p 5439 -U postgres -d postgres -c "create database ci_test;"
114-
env:
115-
PGPASSWORD: postgres
116-
- name: Build with testing
117-
run: ./gradlew --stacktrace :embulk-output-redshift:check
118-
env:
119-
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
120-
EMBULK_OUTPUT_REDSHIFT_TEST_CONFIG: "${{ github.workspace }}/ci/redshift.yml"
121-
- uses: actions/upload-artifact@v3
122-
if: always()
123-
with:
124-
name: redshift
125-
path: embulk-output-redshift/build/reports/tests/test
126-
if-no-files-found: ignore
127-
sqlserver:
212+
- uses: actions/checkout@v4
213+
- name: Set up JDK 8
214+
uses: actions/setup-java@v4
215+
with:
216+
java-version: 8
217+
distribution: 'zulu'
218+
cache: "gradle"
219+
- name: Connect
220+
run: psql -h 127.0.0.1 -p 5439 -U postgres -d postgres -c "\l"
221+
env:
222+
PGPASSWORD: postgres
223+
- name: Create database
224+
run: psql -h 127.0.0.1 -p 5439 -U postgres -d postgres -c "create database ci_test;"
225+
env:
226+
PGPASSWORD: postgres
227+
- name: Build with testing
228+
run: ./gradlew --stacktrace :embulk-output-redshift:check
229+
env:
230+
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
231+
EMBULK_OUTPUT_REDSHIFT_TEST_CONFIG: "${{ github.workspace }}/ci/redshift.yml"
232+
- uses: actions/upload-artifact@v4
233+
if: always()
234+
with:
235+
name: redshift
236+
path: embulk-output-redshift/build/reports/tests/test
237+
if-no-files-found: ignore
238+
sqlserver: # TODO: Use https://hub.docker.com/_/microsoft-mssql-server
128239
runs-on: ubuntu-latest
129240
# push: always run.
130241
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
131242
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
132243
strategy:
133244
fail-fast: false
134245
steps:
135-
- uses: actions/checkout@v3
136-
- name: Set up JDK 8
137-
uses: actions/setup-java@v3
138-
with:
139-
java-version: 8
140-
distribution: 'temurin'
141-
cache: "gradle"
142-
- name: Build-only
143-
run: ./gradlew --stacktrace :embulk-output-sqlserver:compileJava :embulk-output-sqlserver:compileTestJava
246+
- uses: actions/checkout@v4
247+
- name: Set up JDK 8
248+
uses: actions/setup-java@v4
249+
with:
250+
java-version: 8
251+
distribution: 'zulu'
252+
cache: "gradle"
253+
- name: Build-only
254+
run: ./gradlew --stacktrace :embulk-output-sqlserver:compileJava :embulk-output-sqlserver:compileTestJava

0 commit comments

Comments
 (0)