-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
103 lines (95 loc) · 2.24 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
100
101
102
103
stages:
- lint
- test
# - inspect
- verify
- build
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
paths:
- .gradle/wrapper
- .gradle/caches
ktlint:
stage: lint
only:
- main
- merge_requests
image: gradle:8.1-jdk11
script:
- ./gradlew ktlintCheck
test:
stage: test
only:
- main
- merge_requests
image: gradle:8.1-jdk11
script:
- ./gradlew test
# qodana:
# stage: inspect
# only:
# - main
# - merge_requests
# image:
# name: jetbrains/qodana-jvm-community:2024.1
# entrypoint: [""]
# cache:
# - key: qodana-2024.1-$CI_DEFAULT_BRANCH-$CI_COMMIT_REF_SLUG
# fallback_keys:
# - qodana-2024.1-$CI_DEFAULT_BRANCH-
# - qodana-2024.1-
# paths:
# - .qodana/cache
# script:
# - qodana --results-dir=$CI_PROJECT_DIR/.qodana/results
# --cache-dir=$CI_PROJECT_DIR/.qodana/cache
# artifacts:
# reports:
# codequality: .qodana/results/gl-code-quality-report.json
plugin-verifier:
stage: verify
only:
- main
image: gradle:8.1-jdk11
cache:
- key: plugin-verifier-$CI_DEFAULT_BRANCH-$CI_COMMIT_REF_SLUG
fallback_keys:
- plugin-verifier-$CI_DEFAULT_BRANCH-
- plugin-verifier-
paths:
- .pluginVerifier/ides
script:
- ./gradlew runPluginVerifier
pre-build:
stage: build
only:
- main
image: gradle:8.1-jdk11
script:
- export PLUGIN_NAME=$(cat gradle.properties | grep 'pluginName = .*' | awk -F '= ' '{print $2}')
- export PLUGIN_VERSION=$(cat gradle.properties | grep 'pluginVersion = .*' | awk -F '= ' '{print $2}')
- export ARTIFACT_FOLDER="${PLUGIN_NAME}-${PLUGIN_VERSION}"
- echo $ARTIFACT_FOLDER
- echo "PLUGIN_NAME=${PLUGIN_NAME}" >> build.dotenv
- echo "PLUGIN_VERSION=${PLUGIN_VERSION}" >> build.dotenv
- echo "ARTIFACT_FOLDER=${ARTIFACT_FOLDER}" >> build.dotenv
artifacts:
reports:
dotenv: build.dotenv
build-plugin:
stage: build
only:
- main
image: gradle:8.1-jdk11
needs:
- pre-build
script:
- ./gradlew buildPlugin
- unzip "build/distributions/${ARTIFACT_FOLDER}.zip" -d content
- mv content/* ./
artifacts:
name: "$ARTIFACT_FOLDER"
paths:
- $PLUGIN_NAME
expire_in: never