This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
98 lines (88 loc) · 1.8 KB
/
.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
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
image: java:8-jdk
stages:
- build
- test
- staging
- publish
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
paths:
- .gradle/wrapper
- .gradle/caches
build:
stage: build
script:
- ./gradlew assemble
artifacts:
paths:
- build/libs/*.jar
expire_in: 1 week
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: $CI_COMMIT_TAG
when: always
- changes:
- '**/*.gradle'
- src/**/*
when: always
checkstyle:
stage: build
script:
- ./gradlew checkstyleMain
- ./gradlew checkstyleTest
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: $CI_COMMIT_TAG
when: never
- changes:
- '**/*.gradle'
- src/**/*
- config/checkstyle/**/*
when: always
test:
stage: test
coverage: '/Total.*?(\d+)%/'
script:
- ./gradlew test --info -PexcludeTests=**/RastreioTest.class
- ./gradlew jacocoTestReport
- cat build/jacocoHtml/index.html | grep -o '<tfoot>.*</tfoot>'
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: $CI_COMMIT_TAG
when: on_success
- changes:
- '**/*.gradle'
- src/**/*
when: on_success
staging:
stage: staging
script:
- ./gradlew test --info -PincludeTests=**/RastreioTest.class
allow_failure: true
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: $CI_COMMIT_TAG
when: on_success
- changes:
- '**/*.gradle'
- src/**/*
when: on_success
checkpublish:
stage: staging
script:
- ./gradlew publishToMavenLocal
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: $CI_COMMIT_TAG
when: on_success
- when: manual
publish:
stage: publish
script:
- ./gradlew publish
rules:
- if: $CI_COMMIT_TAG
when: on_success
- when: never
# TODO: publish to gh-pages