Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add PostgreSQL 13 and MySQL 8. #229

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 113 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test
on: push
on: [push, pull_request]
jobs:
mysql:
mysql5_7:
strategy:
fail-fast: false
runs-on: ubuntu-latest
Expand All @@ -16,8 +16,8 @@ jobs:
MYSQL_USER: ci
MYSQL_PASSWORD: password
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
Expand All @@ -30,12 +30,68 @@ jobs:
env:
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
EMBULK_INPUT_MYSQL_TEST_CONFIG: "${{ github.workspace }}/ci/mysql.yml"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: mysql
name: mysql5_7
path: embulk-input-mysql/build/reports/tests/test
postgresql:
mysql8:
strategy:
fail-fast: false
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.3 # mysql 8.4 disabled mysql_native_password by default
options: --health-cmd "mysqladmin ping -h localhost" --health-interval 20s --health-timeout 10s --health-retries 10
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: ci
MYSQL_PASSWORD: password
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
- name: Connect
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "show databases;"
- name: show version
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "select version();"
- name: Create database
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "create database ci_test;"
#
# MySQL 8 uses caching_sha2_password mechanism by default.
# Connector/J 5.x doesn't support it.
#
# This part change password mechanism to mysql_native_password.
# Remove the following part after update Connector/J
#
- name: Show password plugins
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "SELECT user, host, plugin FROM mysql.user;"
- name: Change password mechanism1 (root@localhost)
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"
- name: Change password mechanism2 (root@%)
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';"
- name: FLUSH PRIVILEGES
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "FLUSH PRIVILEGES;"
- name: Show password plugins2
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "SELECT user, host, plugin FROM mysql.user;"
#
# End caching_sha2_password workaround.
#
- name: Build with testing
run: ./gradlew --stacktrace :embulk-input-mysql:check
env:
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
EMBULK_INPUT_MYSQL_TEST_CONFIG: "${{ github.workspace }}/ci/mysql.yml"
- uses: actions/upload-artifact@v4
if: always()
with:
name: mysql8_3
path: embulk-input-mysql/build/reports/tests/test
postgresql9_4:
runs-on: ubuntu-latest
services:
postgres:
Expand All @@ -46,15 +102,55 @@ jobs:
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
- name: Connect
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "\l"
env:
PGPASSWORD: postgres
- name: Create database
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "create database ci_test;"
env:
PGPASSWORD: postgres
- name: Build with testing
run: ./gradlew --stacktrace :embulk-input-postgresql:check
env:
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
EMBULK_INPUT_POSTGRESQL_TEST_CONFIG: "${{ github.workspace }}/ci/postgresql.yml"
- uses: actions/upload-artifact@v4
if: always()
with:
name: postgresql9_4
path: embulk-input-postgresql/build/reports/tests/test
# PostgreSQL 14 and later, raise the exception "The authentication type 10 is not supported."
# Use PostgreSQL 13 at this time.
postgresql13:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- "5432:5432"
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
- name: Connect
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "\l"
env:
PGPASSWORD: postgres
- name: Show version
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "select * from version();"
env:
PGPASSWORD: postgres
- name: Create database
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "create database ci_test;"
env:
Expand All @@ -64,10 +160,10 @@ jobs:
env:
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
EMBULK_INPUT_POSTGRESQL_TEST_CONFIG: "${{ github.workspace }}/ci/postgresql.yml"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: postgresql
name: postgresql13
path: embulk-input-postgresql/build/reports/tests/test
redshift:
runs-on: ubuntu-latest
Expand All @@ -81,8 +177,8 @@ jobs:
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
Expand All @@ -99,7 +195,7 @@ jobs:
env:
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
EMBULK_INPUT_REDSHIFT_TEST_CONFIG: "${{ github.workspace }}/ci/redshift.yml"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: redshift
Expand All @@ -118,8 +214,8 @@ jobs:
ACCEPT_EULA: Y
SA_PASSWORD: "P@ssw0rd"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
Expand All @@ -146,7 +242,7 @@ jobs:
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
EMBULK_INPUT_SQLSERVER_TEST_CONFIG: "${{ github.workspace }}/ci/sqlserver.yml"
EMBULK_INPUT_SQLSERVER_TEST_SQLCMD_COMMAND: "docker exec mssqlcontainer /opt/mssql-tools/bin/sqlcmd"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: sqlserver
Expand Down