Skip to content

spotless apply

spotless apply #24

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Database Tests
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
jobs:
build:
name: "maven-compile (java-${{ matrix.java }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 8 , 17 ]
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: stream-query
MYSQL_DATABASE: stream-query
ports:
- 3306:3306
postgres:
image: postgres
env:
POSTGRES_DB: stream-query
POSTGRES_USER: stream-query
POSTGRES_PASSWORD: stream-query
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build with Maven
run: mvn -B package -DskipTests --file pom.xml
- name: Run H2 Tests (Default)
run: mvn test
- name: Execute MySQL schema and data scripts
run: |
mysql -h 127.0.0.1 -P 3306 -u root --password=stream-query stream-query < stream-plugin/stream-plugin-mybatis-plus/src/test/resources/sql/mysql/schema.sql
mysql -h 127.0.0.1 -P 3306 -u root --password=stream-query stream-query < stream-plugin/stream-plugin-mybatis-plus/src/test/resources/sql/mysql/data.sql
- name: Run MySQL Tests
run: mvn test -Dspring.profiles.active=mysql
- name: Execute PostgreSQL schema and data scripts
run: |
PGPASSWORD=stream-query psql -h localhost -U stream-query -d stream-query -p 5432 -a -f stream-plugin/stream-plugin-mybatis-plus/src/test/resources/sql/pgsql/schema.sql
PGPASSWORD=stream-query psql -h localhost -U stream-query -d stream-query -p 5432 -a -f stream-plugin/stream-plugin-mybatis-plus/src/test/resources/sql/pgsql/data.sql
- name: Run PostgreSQL Tests
run: mvn test -Dspring.profiles.active=pgsql