This repository has been archived by the owner on Dec 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
67 lines (60 loc) · 1.56 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
before_script:
- export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home/"
- export ANDROID_HOME=$HOME/Library/Android/sdk
- export PATH=$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
variables:
JACOCO_CSV_FILE: '$CI_PROJECT_DIR/connect-sdk/build/reports/jacoco/jacocoTestReport/jacocoTestReport.csv'
stages:
- build
- postbuild
- scan
- sonatype
- release
build_project:
stage: build
script:
- ./gradlew connect-sdk:clean
- ./gradlew connect-sdk:assemble
tags:
- xcode
coverage:
stage: postbuild
script:
- ./ci/start-emu
- ./gradlew connect-sdk:createDebugCoverageReport
- ./ci/stop-emu
- ./gradlew connect-sdk:testDebugUnitTest
- ./gradlew connect-sdk:jacocoTestReport
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { printf "Test Coverage %0.2f%%\n", 100*covered/instructions }' $JACOCO_CSV_FILE
artifacts:
when: always
paths:
- connect-sdk/build/outputs/
- connect-sdk/build/jacoco/
- connect-sdk/build/reports/
expire_in: 1 days
tags:
- xcode
sonarqube:
stage: scan
script:
- ./gradlew connect-sdk:sonarqube
tags:
- xcode
publish_to_staging:
stage: sonatype
script:
- ./gradlew connect-sdk:clean
- ./gradlew connect-sdk:assembleRelease
- ./gradlew connect-sdk:publishToSonatype closeSonatypeStagingRepository
tags:
- xcode
release:
stage: release
only:
- master
when: manual
script:
- ./gradlew releaseSonatypeStagingRepository
tags:
- xcode