Test with more verbose logging #288
Workflow file for this run
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
name: Build and test | |
on: push | |
jobs: | |
mysql: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
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@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: 8 | |
distribution: 'zulu' | |
- name: Connect | |
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "show databases;" | |
- name: Create database | |
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "create database ci_test;" | |
- 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@v2 | |
if: always() | |
with: | |
name: mysql | |
path: embulk-input-mysql/build/reports/tests/test | |
postgresql: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:9.4 | |
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@v2 | |
- uses: actions/setup-java@v2 | |
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@v2 | |
if: always() | |
with: | |
name: postgresql | |
path: embulk-input-postgresql/build/reports/tests/test | |
redshift: | |
runs-on: ubuntu-latest | |
# Testing embulk-input-redshift emulated with PostgreSQL. | |
services: | |
postgres: | |
image: postgres:9.4 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
ports: | |
- "5439:5432" | |
env: | |
POSTGRES_PASSWORD: postgres | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: 8 | |
distribution: 'zulu' | |
- name: Connect | |
run: psql -h 127.0.0.1 -p 5439 -U postgres -d postgres -c "\l" | |
env: | |
PGPASSWORD: postgres | |
- name: Create database | |
run: psql -h 127.0.0.1 -p 5439 -U postgres -d postgres -c "create database ci_test;" | |
env: | |
PGPASSWORD: postgres | |
- name: Build with testing | |
run: ./gradlew --stacktrace :embulk-input-redshift:check | |
env: | |
_JAVA_OPTIONS: "-Xmx2048m -Xms512m" | |
EMBULK_INPUT_REDSHIFT_TEST_CONFIG: "${{ github.workspace }}/ci/redshift.yml" | |
- uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: redshift | |
path: embulk-input-redshift/build/reports/tests/test | |
sqlserver: # https://hub.docker.com/_/microsoft-mssql-server | |
runs-on: ubuntu-latest | |
services: | |
sqlserver: | |
# To run locallly: | |
# docker run -it --name mssqlcontainer -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=somepassword' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-CU4-ubuntu-16.04 | |
image: docker://mcr.microsoft.com/mssql/server:2019-CU4-ubuntu-16.04 | |
options: --name "mssqlcontainer" --health-cmd "/opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P P@ssw0rd -Q \"SELECT * FROM sys.objects;\"" --health-interval 20s --health-timeout 30s --health-retries 128 | |
ports: | |
- "1433:1433" | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: "P@ssw0rd" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: 8 | |
distribution: 'zulu' | |
# TODO: Find a better way to wait for completing setup. | |
- name: Sleep for 30 seconds to complete all the SQL Server setup process | |
run: sleep 30 | |
- name: List Docker containers | |
run: docker ps -a | |
- name: Confirm log | |
run: docker logs mssqlcontainer | |
- name: Copy test resources into Docker container | |
run: docker cp ${{ github.workspace }}/embulk-input-sqlserver/src/test/resources/org/embulk/input/sqlserver/test/expect/. mssqlcontainer:/tmp | |
- name: List resource files | |
run: docker exec mssqlcontainer ls -R /tmp | |
- name: Show SQL Server objects | |
run: docker exec mssqlcontainer /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P "P@ssw0rd" -Q "SELECT * FROM sys.objects;" | |
- name: Create testdb | |
run: docker exec mssqlcontainer /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P "P@ssw0rd" -Q "CREATE DATABASE testdb;" | |
- name: Show SQL Server objects in testdb | |
run: docker exec mssqlcontainer /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P "P@ssw0rd" -d testdb -Q "SELECT * FROM sys.objects;" | |
- name: Build with testing | |
run: ./gradlew --stacktrace :embulk-input-sqlserver:check | |
env: | |
_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 | |
if: always() | |
with: | |
name: sqlserver | |
path: embulk-input-sqlserver/build/reports/tests/test |