-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (68 loc) · 2.11 KB
/
build.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master, dev ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: cinemadb
MYSQL_USER: admin
MYSQL_PASSWORD: admin
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup database
run: |
mysql --host 127.0.0.1 --port 3306 -uroot < ./service/persistence/src/main/resources/cinemadb.sql
mysql --host 127.0.0.1 --port 3306 -uroot -e 'call popola();' cinemadb
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 11
- name: Setup Chrome driver
uses: nanasess/[email protected]
- name: Cache SonarCloud packages
uses: actions/[email protected]
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/[email protected]
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Build with Gradle and analyze with Sonarqube
run: |
./gradlew assemble
java -jar ./ui/web/build/libs/web.jar &
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac $DISPLAY -screen 0 1920x1080x24 > /dev/null 2>&1 &
./gradlew build
./gradlew sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DISPLAY: :99