summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorAmit Kumar <amitkma@e.email>2021-04-28 05:58:38 +0000
committerAmit Kumar <amitkma@e.email>2021-04-28 05:58:38 +0000
commit1339616a3fb53ba6eb9e78da6e9e0daa99936fee (patch)
treef32cd3cfc09634efdc16e1a06b03e8d76870648e /.gitlab-ci.yml
parentf3759a7935fcba76195d52084ee3254ec85391c3 (diff)
parent43e9b964e80045d989b8e5a7dec31067ed57c686 (diff)
Merge branch 'gitlab-ci' into 'master'
Add gitlab-ci configuration See merge request e/privacy-central/privacycentralapp!1
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml95
1 files changed, 95 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..da31bd1
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,95 @@
+image: "registry.gitlab.e.foundation:5000/e/apps/docker-android-apps-cicd:latest"
+
+stages:
+ - update
+ - qa
+ - build
+ - test
+
+workflow:
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"'
+ when: never
+ - if: '$CI_COMMIT_BRANCH'
+
+before_script:
+ - export GRADLE_USER_HOME=$(pwd)/.gradle
+ - chmod +x ./gradlew
+
+cache:
+ key: ${CI_PROJECT_ID}
+ paths:
+ - .gradle/
+
+nightly-tasks:
+ stage: update
+ script:
+ - ./gradlew dependencyUpdates
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ artifacts:
+ paths:
+ - build/dependencyUpdates
+
+quality-analysis:
+ stage: qa
+ script:
+ - ./gradlew spotlessCheck
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ when: never
+ - if: '$CI_COMMIT_BRANCH == "master"'
+ when: never
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ when: never
+ - when: always
+
+build-debug:
+ stage: build
+ script:
+ - ./gradlew assembleDebug
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ when: never
+ - if: '$CI_COMMIT_BRANCH == "master"'
+ when: never
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ when: never
+ - when: on_success
+ artifacts:
+ paths:
+ - app/build/outputs/apk
+
+test-debug:
+ stage: test
+ script:
+ - ./gradlew testDebug --stacktrace
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ when: never
+ - if: '$CI_COMMIT_BRANCH == "master"'
+ when: never
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ when: never
+ - when: on_success
+ artifacts:
+ paths:
+ - ./**/build/reports/tests/testDebugUnitTest
+
+build-full:
+ stage: build
+ script:
+ - ./gradlew build
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ when: never
+ - if: '$CI_COMMIT_BRANCH == "master"'
+ when: always
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
+ when: always
+ - when: never
+ artifacts:
+ paths:
+ - app/build/outputs/apk
+ - app/build/reports