forked from airsonic-advanced/airsonic-advanced
-
Notifications
You must be signed in to change notification settings - Fork 17
122 lines (117 loc) · 4.6 KB
/
pr_ci.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: 'PR CI (Maven)'
on:
pull_request:
branches: [ main ]
paths-ignore:
- "**.md"
- "*.txt"
- ".github/**"
- "!.github/workflows/pr_ci.yml"
env:
DEFAULT_MUSIC_FOLDER: /tmp/music
EXCLUDED_TEST_GROUPS:
jobs:
build:
runs-on: ubuntu-latest
env: ${{ matrix.cfg.env }}
services: ${{ matrix.cfg.services }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.cfg.jdk }}
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Setup ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
id: setup-ffmpeg
- run: mkdir -p ${DEFAULT_MUSIC_FOLDER}
- run: ${{ matrix.cfg.run }}
if: matrix.cfg.executeManualcommand
- name: Build with Maven
run: mvn -DexcludedGroups=${EXCLUDED_TEST_GROUPS} -Ddocker.testing.default-music-folder=${DEFAULT_MUSIC_FOLDER} verify -B -P integration-test
strategy:
fail-fast: false
matrix:
cfg:
- jdk: 17
services: {}
env: {}
# external dbs
- jdk: 17
services:
postgres:
image: 'postgres:13.3-alpine'
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: pass
env:
spring_datasource_url: 'jdbc:postgresql://localhost:5432/postgres?stringtype=unspecified&raiseExceptionOnSilentRollback=false'
spring_datasource_username: postgres
spring_datasource_password: pass
EXCLUDED_TEST_GROUPS: org.airsonic.player.util.EmbeddedTestCategory
- jdk: 17
services:
postgres:
image: 'postgres:14.1-alpine'
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: pass
env:
spring_datasource_url: 'jdbc:postgresql://localhost:5432/postgres?stringtype=unspecified&raiseExceptionOnSilentRollback=false'
spring_datasource_username: postgres
spring_datasource_password: pass
EXCLUDED_TEST_GROUPS: org.airsonic.player.util.EmbeddedTestCategory
- jdk: 17
db: 'mysql:8.0'
executeManualCommand: true
run: >
docker pull ${DB};
docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=${spring_datasource_password} -e MYSQL_DATABASE=airsonic -p 3306:3306 ${DB} --character-set-server=utf8mb4 --collation-server=utf8mb4_bin;
until docker run --rm --link mysql:ms ${DB} mysql --host=ms --user=${spring_datasource_username} --password=${spring_datasource_password} -e 'SELECT 1' &> /dev/null; do sleep 1; done;
services: {}
services2:
mysql:
image: 'mysql:8.0'
ports:
- 3306:3306
env:
MYSQL_DATABASE: airsonic
MYSQL_ROOT_PASSWORD: pass
env:
DB: 'mysql:8.0'
spring_datasource_url: 'jdbc:mysql://localhost:3306/airsonic'
spring_datasource_username: root
spring_datasource_password: pass
EXCLUDED_TEST_GROUPS: org.airsonic.player.util.EmbeddedTestCategory
- jdk: 17
db: 'mariadb:10.5'
executeManualCommand: true
run: >
docker pull ${DB};
docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=${spring_datasource_password} -e MYSQL_DATABASE=airsonic -p 3306:3306 ${DB} --character-set-server=utf8mb4 --collation-server=utf8mb4_bin;
until docker run --rm --link mysql:ms ${DB} mysql --host=ms --user=${spring_datasource_username} --password=${spring_datasource_password} -e 'SELECT 1' &> /dev/null; do sleep 1; done;
services: {}
services2:
mysql:
image: 'mariadb:10.5'
ports:
- 3306:3306
env:
MYSQL_DATABASE: airsonic
MYSQL_ROOT_PASSWORD: pass
env:
DB: 'mariadb:10.5'
spring_datasource_url: 'jdbc:mariadb://localhost:3306/airsonic'
spring_datasource_username: root
spring_datasource_password: pass
EXCLUDED_TEST_GROUPS: org.airsonic.player.util.EmbeddedTestCategory