-
Notifications
You must be signed in to change notification settings - Fork 460
105 lines (101 loc) · 3.03 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Build and Test
on:
push:
branches: [master, dev]
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE'
- '.gitignore'
- 'provisioning'
- '.sonarcloud.properties'
- 'LICENSE'
- 'Vagrantfile'
pull_request:
branches: [master, dev]
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE'
- '.gitignore'
- 'provisioning'
- '.sonarcloud.properties'
- 'LICENSE'
- 'Vagrantfile'
jobs:
lint-java:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: axel-op/googlejavaformat-action@fe78db8a90171b6a836449f8d0e982d5d71e5c5a #v3.6.0
with:
args: "--set-exit-if-changed"
build:
needs: lint-java
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build Maven with Docker Profile
run: mvn clean install -Pdocker -DskipTests -B
- name: Docker Compose Build
run: docker-compose build
unit-tests:
needs: [lint-java, build]
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: core
ports:
- '8888:3306'
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Start MYSQL Server
run: sudo /etc/init.d/mysql start
- name: Modify MySQL Connection Variables
run: |
sed -i "s/'@'localhost'/'@'%'/g" ${GITHUB_WORKSPACE}/src/main/resources/database/moduleSchemas.sql
sed -i 's/TEST_MYSQL_PORT=3306/TEST_MYSQL_PORT=8888/g' ${GITHUB_WORKSPACE}/.env
- name: Run Unit Tests
run: mvn test -B -e -X
integration-tests:
needs: [lint-java, build]
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: core
ports:
- '8888:3306'
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Start MYSQL Server
run: sudo /etc/init.d/mysql start
- name: Modify MySQL Connection Variables
run: |
sed -i "s/'@'localhost'/'@'%'/g" ${GITHUB_WORKSPACE}/src/main/resources/database/moduleSchemas.sql
sed -i 's/TEST_MYSQL_PORT=3306/TEST_MYSQL_PORT=8888/g' ${GITHUB_WORKSPACE}/.env
- name: Prepare Intergration Tests
run: |
sudo apt-get -y install libargon2-0
mvn -Pdocker validate
- name: Run Intergration Tests
run: |
mvn verify -DskipUTs=true -DmongoDocker -B