-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (112 loc) · 4.48 KB
/
maven.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
123
124
125
126
127
128
129
130
131
132
133
134
135
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
branches: ["master"]
pull_request:
branches: ["**"]
env:
LANG: "fr_FR.UTF-8"
LC_ALL: "fr_FR.UTF-8"
LANGUAGE: "fr_FR.UTF-8"
LC_CTYPE: "fr_FR.UTF-8"
TZ: "Europe/Paris"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: ["17"]
node: ["18"]
mariadb: ["10.6", "latest"]
env:
MARIADB_IMG: "wodby/mariadb"
name: Run MariaDB ${{ matrix.mariadb }} + java ${{ matrix.java }} + node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Paris"
- name: Set up locale ENV
run: |
sudo locale-gen $LANG
sudo update-locale LANG=$LANG
sudo apt install net-tools
- name: Set up variable ENV
if: startsWith(matrix.java, '8')
run: |
echo "MVN_PARAMS=-Dmaven.compiler.target=1.8" >> $GITHUB_ENV
- name: Check locales
run: locale -a
- name: Pull mariadb:${{ matrix.mariadb }} docker image
run: docker pull ${MARIADB_IMG}:${{ matrix.mariadb }}
- name: Run MariaDB container
run: |
docker run -t -d --name mariadb --rm -v \
--health-cmd="mysqladmin -uroot -proot ping" --health-interval=10s --health-timeout=10s --health-retries=10 \
-p 3306:3306/tcp \
-e "TZ=Europe/Paris" \
-e "MYSQL_USER=root" \
-e "MYSQL_ROOT_PASSWORD=root" \
-e "MYSQL_DATABASE=DB_NAME" \
-e "MYSQL_DEFAULT_STORAGE_ENGINE=InnoDB" \
-e "MYSQL_CHARACTER_SET_SERVER=utf8mb4" \
-e "MYSQL_COLLATION_SERVER=utf8mb4_unicode_520_ci" \
-e "MYSQL_INNODB_BUFFER_POOL_SIZE=2G" \
-e "MYSQL_INNODB_DEFAULT_ROW_FORMAT=dynamic" \
-e "MYSQL_INNODB_DATA_FILE_PATH=ibdata1:100M:autoextend:max:10G" \
-e "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT=1" \
-e "MYSQL_INNODB_LOG_BUFFER_SIZE=64M" \
-e "MYSQL_INNODB_LOG_FILE_SIZE=256M" \
-e "MYSQL_INNODB_STRICT_MODE=ON" \
-e "MYSQL_LOWER_CASE_TABLE_NAMES=1" \
-e "MYSQL_MAX_CONNECT_ERRORS=100" \
-e "MYSQL_MAX_CONNECTIONS=1000" \
-e "MYSQL_QUERY_CACHE_LIMIT=10M" \
-e "MYSQL_QUERY_CACHE_SIZE=0" \
-e "MYSQL_QUERY_CACHE_TYPE=OFF" \
${MARIADB_IMG}:${{ matrix.mariadb }} &
sleep 30
- name: Test MariaDB
run: docker exec mariadb /bin/bash -c "mysql -h127.0.0.1 -uroot -proot -e \"show variables like '%time_zone'; select now();\""
- name: Check date
run: |
date
mysql -h127.0.0.1 -uroot -proot -e "show variables like '%time_zone'; select now();"
- name: Set up JDK ${{ matrix.java }} version
uses: actions/setup-java@v3
with:
java-version: "${{ matrix.java }}"
distribution: "temurin"
cache: "maven"
- name: Set up Node ${{ matrix.node }} version
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: DB connection test and conf checks
run: |
netstat -pnltu
mysql -h127.0.0.1 -uroot -proot -e "SHOW DATABASES;"
mysql -h127.0.0.1 -uroot -proot -e "show variables like 'char%'; show variables like 'collation%';show variables like 'innodb_default_row_format';"
mysql -h127.0.0.1 -uroot -proot -e "USE DB_NAME;SHOW TABLES;"
- name: Project requirements
run: |
./mvnw --version
mkdir -p ${{ github.workspace }}/tmp
# yarn setup
yarn install --frozen-lockfile --immutable
yarn test:unit
# - name: Check NOTICE for missing dependencies in listing
# run: ./mvnw -B notice:check
- name: Check for missing license hearder
run: ./mvnw license:check
# - name: Build with Maven
# run: ./mvnw -B package --file pom.xml
# - name: Test with Maven
# run: ./mvnw -B test --file pom.xml