-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
99 lines (93 loc) · 2.54 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
99
# snmp-cockpit
#
# Copyright (C) 2018-2023
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
image: android-ci-image:latest
# Packages installation before running script
before_script:
# Setup path as android_home for moving/exporting the downloaded sdk into it
- export ANDROID_HOME="/android-home"
- export PATH="$PATH:${ANDROID_HOME}/cmdline-tools/cmdline-tools/bin"
- sdkmanager --version
- ./gradlew
# Basic android and gradle stuff
# Check linting
lintDebug:
interruptible: true
stage: build
allow_failure: true
script:
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint --build-cache --gradle-user-home cache/
cache:
key:
files:
- gradle/wrapper/gradle-wrapper.properties
paths:
- cache/caches/
- cache/notifications/
- cache/wrapper/
# Make Project
assembleDebug:
interruptible: true
stage: build
script:
- ./gradlew --build-cache --gradle-user-home cache/ assembleDebug
artifacts:
paths:
- app/build/outputs/
cache:
key:
files:
- gradle/wrapper/gradle-wrapper.properties
paths:
- cache/caches/
- cache/notifications/
- cache/wrapper/
# Make release
assembleRelease:
interruptible: true
stage: build
when: on_success
only:
refs:
- main
- feature/*
- fix/*
script:
- ./gradlew --build-cache --gradle-user-home cache/ assembleRelease
artifacts:
paths:
- app/build/outputs/
cache:
key:
files:
- gradle/wrapper/gradle-wrapper.properties
paths:
- cache/caches/
- cache/notifications/
- cache/wrapper/
# Run all tests, if any fails, interrupt the pipeline(fail it)
debugTests:
interruptible: true
stage: test
script:
- ./gradlew -Pci --build-cache --gradle-user-home cache/ --console=plain :app:testDebug
cache:
key:
files:
- gradle/wrapper/gradle-wrapper.properties
paths:
- cache/caches/
- cache/notifications/
- cache/wrapper/