-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
44 lines (38 loc) · 982 Bytes
/
.gitlab-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
services:
- docker:24.0.5-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
stages:
- build
- test
build-backend:
stage: test
image: docker:24.0.5
script:
- docker build -t meditrack-backend backend/
rules:
- when: never # can't run because dind doesn't work
build-frontend:
stage: test
image: docker:24.0.5
script:
- docker build -t meditrack-frontend frontend/
rules:
- when: never # can't run because dind doesn't work
test-backend:
stage: test
image: maven:3-openjdk-17
script:
- cd backend
- mvn verify -Dspring.profiles.active=excludeTestcontainers
- CODE_COVERAGE=$(cat target/site/jacoco/index.html | grep -oP '(?<=<td class="ctr2">)[^<]+(?=</td>)' | head -1)
- echo "Executed tests successfully with $CODE_COVERAGE code coverage"
artifacts:
paths:
- backend/target/site/jacoco
test-backend-checkstyle:
stage: test
image: maven:3-openjdk-17
script:
- cd backend
- mvn checkstyle:check