Skip to content

Commit

Permalink
Merge pull request #66 from is0xjh25/CI-test
Browse files Browse the repository at this point in the history
update Ci test
  • Loading branch information
Lingxiao108105 authored Sep 25, 2021
2 parents 01362f9 + 7a26046 commit dbdeffd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
36 changes: 30 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

name: Java CI with Maven

#only test when push to main or pull_request to main
on:
[push]
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
push:
branches: [ main ]
pull_request:
branches: [ main ]


#Build't job
jobs:
#Test's job
tests:
name: Unit tests
name: Integration tests
#Run on Ubuntu using the latest version
runs-on: ubuntu-latest

Expand All @@ -32,6 +32,30 @@ jobs:
distribution: 'adopt'
cache: maven

- name: Setup MySQL
# You may pin to the exact commit or the version.
# uses: mirromutth/mysql-action@de1fba8b3f90ce8db80f663a7043be3cf3231248
uses: mirromutth/[email protected]
with:
# The port of host
host port: 3306
# The port of container
container port: 3306
# --character-set-server - The character set of MySQL server
character set server: utf8mb4
# --collation-server - The character collation of MySQL server
collation server: utf8mb4_general_ci
# Version of MySQL to use
mysql version: 8
# MYSQL_ROOT_PASSWORD - root superuser password
mysql root password: 415623
# MYSQL_DATABASE - name for the default database that is created
mysql database: testdb
# MYSQL_USER - create the specified user with superuser power for created database
mysql user: root
# MYSQL_PASSWORD - specified superuser password which user is power for created database
mysql password: 415623

#Run Tests
- name: Run Tests
run: mvn -B test
6 changes: 3 additions & 3 deletions src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://mydb.mysql.database.azure.com:3306/testdb?reconnect=true
username: yyds
password: comp30022-
url: jdbc:mysql://localhost:3306/testdb
username: root
password: 415623
schema: classpath:db/schema-test.sql
data: classpath:db/data-test.sql
initialization-mode: always
Expand Down

0 comments on commit dbdeffd

Please sign in to comment.