2020-04-21 10:43:05 +00:00
|
|
|
before_script:
|
2022-03-02 10:02:29 +00:00
|
|
|
- source /load-env.sh
|
2020-04-21 10:43:05 +00:00
|
|
|
- export JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=$( echo ${http_proxy##http://} | cut -d':' -f1 ) -Dhttp.proxyPort=$( echo ${http_proxy##http://} | cut -d':' -f2 ) -Dhttps.proxyHost=$( echo ${https_proxy##http://} | cut -d':' -f1 ) -Dhttps.proxyPort=$( echo ${https_proxy##http://} | cut -d':' -f2 ) -Dhttp.nonProxyHosts=\"$( echo $no_proxy | tr ',' '|' )\""
|
|
|
|
- export GRADLE_USER_HOME=`pwd`/.gradle
|
2020-08-11 09:00:27 +00:00
|
|
|
- export VERSION_NAME=$(grep -E "versionName " buildSrc/src/main/kotlin/ProtonMail.kt | awk '{print $5}' | sed s/\"//g)
|
|
|
|
- export VERSION_CODE=$(grep -E "versionCode " buildSrc/src/main/kotlin/ProtonMail.kt | awk '{print $5}' | sed s/\"//g)
|
2021-11-24 11:36:55 +00:00
|
|
|
|
2023-03-30 13:35:45 +00:00
|
|
|
image: ${CI_REGISTRY}/android/shared/docker-android:v1.1.0
|
2022-03-02 10:02:29 +00:00
|
|
|
|
2020-04-21 10:43:05 +00:00
|
|
|
cache:
|
2020-12-04 11:54:10 +00:00
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
2020-04-21 10:43:05 +00:00
|
|
|
paths:
|
2020-12-04 11:54:10 +00:00
|
|
|
- .gradle
|
2020-12-04 11:37:12 +00:00
|
|
|
- '**/build'
|
|
|
|
- '**/**/build'
|
|
|
|
- '**/**/**/build'
|
2020-04-21 10:43:05 +00:00
|
|
|
|
|
|
|
stages:
|
2020-10-14 15:05:15 +00:00
|
|
|
- manual-release
|
2020-04-21 10:43:05 +00:00
|
|
|
- analyze
|
|
|
|
- build
|
2021-10-14 09:25:56 +00:00
|
|
|
- startReview
|
2020-04-21 10:43:05 +00:00
|
|
|
- test
|
|
|
|
- bot-i18n
|
|
|
|
- bot-release
|
2022-02-17 14:53:49 +00:00
|
|
|
- fixups
|
2020-04-21 10:43:05 +00:00
|
|
|
|
2021-11-24 11:36:55 +00:00
|
|
|
detekt analysis:
|
2020-04-21 10:43:05 +00:00
|
|
|
stage: analyze
|
|
|
|
tags:
|
2021-07-20 15:53:55 +00:00
|
|
|
- large
|
2021-12-14 14:18:29 +00:00
|
|
|
except:
|
|
|
|
- schedules
|
2020-04-21 10:43:05 +00:00
|
|
|
script:
|
2021-12-16 09:54:00 +00:00
|
|
|
- ./gradlew multiModuleDetekt
|
2020-04-21 10:43:05 +00:00
|
|
|
artifacts:
|
2021-07-16 07:49:28 +00:00
|
|
|
expire_in: 1 week
|
|
|
|
paths:
|
|
|
|
- config/detekt/reports/*
|
2020-04-21 10:43:05 +00:00
|
|
|
reports:
|
2021-12-16 09:54:00 +00:00
|
|
|
codequality: config/detekt/reports/mergedReport.json
|
2020-04-21 10:43:05 +00:00
|
|
|
|
2021-11-24 11:36:55 +00:00
|
|
|
build debug:
|
2020-04-21 10:43:05 +00:00
|
|
|
stage: build
|
|
|
|
tags:
|
2022-03-02 10:02:29 +00:00
|
|
|
- xlarge-k8s
|
2020-04-21 10:43:05 +00:00
|
|
|
script:
|
|
|
|
- ./gradlew assembleBetaDebug
|
2020-11-23 15:19:16 +00:00
|
|
|
- ./gradlew assembleBetaDebugAndroidTest
|
2020-04-21 10:43:05 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 1 week
|
|
|
|
paths:
|
|
|
|
- app/build/outputs/apk
|
|
|
|
|
2022-01-05 10:38:38 +00:00
|
|
|
build uiAutomation:
|
|
|
|
stage: build
|
|
|
|
tags:
|
2022-03-02 10:02:29 +00:00
|
|
|
- xlarge-k8s
|
2022-01-05 10:38:38 +00:00
|
|
|
script:
|
2022-01-18 12:06:44 +00:00
|
|
|
- ./gradlew assembleUiAutomationDebug -PtestEnv=live
|
|
|
|
- ./gradlew assembleUiAutomationDebugAndroidTest -PtestEnv=live
|
2022-01-05 10:38:38 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 1 week
|
|
|
|
paths:
|
|
|
|
- app/build/outputs/apk
|
|
|
|
|
2021-05-12 11:32:01 +00:00
|
|
|
build alpha:
|
|
|
|
stage: build
|
|
|
|
when: 'manual'
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
tags:
|
2022-03-02 10:02:29 +00:00
|
|
|
- xlarge-k8s
|
2021-05-12 11:32:01 +00:00
|
|
|
script:
|
|
|
|
- ./gradlew clean
|
2021-05-17 17:11:36 +00:00
|
|
|
- ./gradlew assembleAlphaRelease
|
2021-05-12 11:32:01 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 3 week
|
|
|
|
paths:
|
|
|
|
- app/build/outputs
|
|
|
|
|
2021-11-24 11:36:55 +00:00
|
|
|
build release:
|
2020-04-21 10:43:05 +00:00
|
|
|
stage: build
|
2020-10-12 12:27:38 +00:00
|
|
|
except:
|
|
|
|
- schedules
|
2020-04-21 10:43:05 +00:00
|
|
|
only:
|
|
|
|
- prerelease
|
2021-11-24 11:36:55 +00:00
|
|
|
- release
|
2020-07-06 10:06:04 +00:00
|
|
|
- tags
|
2020-04-21 10:43:05 +00:00
|
|
|
tags:
|
2022-03-02 10:02:29 +00:00
|
|
|
- xlarge-k8s
|
2020-04-21 10:43:05 +00:00
|
|
|
script:
|
2020-12-21 18:43:08 +00:00
|
|
|
- ./gradlew clean
|
2021-02-10 15:11:33 +00:00
|
|
|
- ./gradlew assembleProductionRelease
|
2020-04-21 10:43:05 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 3 week
|
|
|
|
paths:
|
|
|
|
- app/build/outputs
|
|
|
|
|
2021-11-24 11:36:55 +00:00
|
|
|
unit tests:
|
2020-04-21 10:43:05 +00:00
|
|
|
stage: test
|
|
|
|
tags:
|
2022-03-31 11:31:20 +00:00
|
|
|
- xlarge-k8s
|
2020-04-21 10:43:05 +00:00
|
|
|
script:
|
2020-09-23 14:37:38 +00:00
|
|
|
- ./gradlew -Pci --console=plain allTest
|
2020-04-21 10:43:05 +00:00
|
|
|
|
2021-11-24 11:36:55 +00:00
|
|
|
firebase ui tests:
|
2020-12-11 11:07:41 +00:00
|
|
|
stage: test
|
2022-01-05 10:38:38 +00:00
|
|
|
dependencies:
|
|
|
|
- build uiAutomation
|
2020-10-12 12:27:38 +00:00
|
|
|
except:
|
|
|
|
- schedules
|
2020-11-23 09:15:18 +00:00
|
|
|
tags:
|
2020-11-23 15:19:16 +00:00
|
|
|
- medium
|
2020-08-11 09:00:27 +00:00
|
|
|
script:
|
2022-03-02 10:02:29 +00:00
|
|
|
- curl https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz -o /tmp/google-cloud-sdk.tar.gz
|
2020-08-11 09:00:27 +00:00
|
|
|
- mkdir -p /opt
|
|
|
|
- tar zxf /tmp/google-cloud-sdk.tar.gz --directory /opt
|
|
|
|
- /opt/google-cloud-sdk/install.sh --quiet
|
|
|
|
- source /opt/google-cloud-sdk/path.bash.inc
|
2021-12-23 15:33:24 +00:00
|
|
|
- gcloud components install beta --quiet
|
|
|
|
- gcloud components update --quiet
|
2020-09-22 11:52:37 +00:00
|
|
|
- echo $CLOUD_PROJECT_ID_MAIL
|
|
|
|
- gcloud config set project $CLOUD_PROJECT_ID_MAIL
|
|
|
|
- echo $SERVICE_ACCOUNT_MAIL > /tmp/service-account.json
|
2020-08-11 09:00:27 +00:00
|
|
|
- gcloud auth activate-service-account --key-file /tmp/service-account.json
|
2021-12-23 15:33:24 +00:00
|
|
|
- gcloud beta firebase test android run
|
|
|
|
--quiet
|
2022-01-05 10:38:38 +00:00
|
|
|
--app app/build/outputs/apk/uiAutomation/debug/ProtonMail-Android-${VERSION_NAME}-uiAutomation-debug.apk
|
|
|
|
--test app/build/outputs/apk/androidTest/uiAutomation/debug/ProtonMail-Android-${VERSION_NAME}-uiAutomation-debug-androidTest.apk
|
2021-12-23 15:33:24 +00:00
|
|
|
--device model=Pixel2,version=29
|
2020-08-11 09:00:27 +00:00
|
|
|
--test-targets "class ch.protonmail.android.uitests.tests.suites.SmokeSuite"
|
|
|
|
--use-orchestrator
|
2022-01-05 13:58:07 +00:00
|
|
|
--environment-variables clearPackageData=true
|
2021-01-27 21:51:24 +00:00
|
|
|
--num-flaky-test-attempts=1
|
2021-02-02 14:20:51 +00:00
|
|
|
--timeout 45m
|
2020-08-11 09:00:27 +00:00
|
|
|
|
2020-10-12 12:27:38 +00:00
|
|
|
firebase feature tests:
|
|
|
|
stage: test
|
2021-11-24 11:36:55 +00:00
|
|
|
dependencies:
|
2022-01-05 10:38:38 +00:00
|
|
|
- build uiAutomation
|
2020-10-12 12:27:38 +00:00
|
|
|
rules:
|
2022-10-31 15:57:29 +00:00
|
|
|
- when: never
|
2020-11-23 09:15:18 +00:00
|
|
|
tags:
|
2020-12-31 10:18:21 +00:00
|
|
|
- medium
|
2020-11-23 15:19:16 +00:00
|
|
|
variables:
|
|
|
|
MODEL: ""
|
2020-10-12 12:27:38 +00:00
|
|
|
script:
|
2020-11-23 15:19:16 +00:00
|
|
|
- if [ -z ${DEVICE_MODEL+x} ]; then MODEL="Pixel2"; else MODEL=$DEVICE_MODEL; fi
|
2022-03-02 10:02:29 +00:00
|
|
|
- curl https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz -o /tmp/google-cloud-sdk.tar.gz
|
2020-10-12 12:27:38 +00:00
|
|
|
- mkdir -p /opt
|
|
|
|
- tar zxf /tmp/google-cloud-sdk.tar.gz --directory /opt
|
|
|
|
- /opt/google-cloud-sdk/install.sh --quiet
|
|
|
|
- source /opt/google-cloud-sdk/path.bash.inc
|
2021-12-23 15:33:24 +00:00
|
|
|
- gcloud components install beta --quiet
|
2021-02-02 14:20:51 +00:00
|
|
|
- gcloud components update --quiet
|
2020-10-12 12:27:38 +00:00
|
|
|
- echo $CLOUD_PROJECT_ID_MAIL
|
2021-02-02 14:20:51 +00:00
|
|
|
- gcloud config set project $CLOUD_PROJECT_ID_MAIL --quiet
|
2020-10-12 12:27:38 +00:00
|
|
|
- echo $SERVICE_ACCOUNT_MAIL > /tmp/service-account.json
|
2021-02-02 14:20:51 +00:00
|
|
|
- gcloud auth activate-service-account --key-file /tmp/service-account.json --quiet
|
2020-10-12 12:27:38 +00:00
|
|
|
- export CLOUDSDK_CORE_DISABLE_PROMPTS=1
|
2021-02-02 14:20:51 +00:00
|
|
|
- gcloud beta firebase test android run
|
|
|
|
--quiet
|
2022-01-05 10:38:38 +00:00
|
|
|
--app app/build/outputs/apk/uiAutomation/debug/ProtonMail-Android-${VERSION_NAME}-uiAutomation-debug.apk
|
|
|
|
--test app/build/outputs/apk/androidTest/uiAutomation/debug/ProtonMail-Android-${VERSION_NAME}-uiAutomation-debug-androidTest.apk
|
2020-11-23 15:19:16 +00:00
|
|
|
--device model=$MODEL,version=$API_LEVEL
|
2020-10-12 12:27:38 +00:00
|
|
|
--test-targets "class ch.protonmail.android.uitests.tests.$TEST_CLASS"
|
|
|
|
--use-orchestrator
|
2022-01-05 13:58:07 +00:00
|
|
|
--environment-variables clearPackageData=true
|
2020-10-12 12:27:38 +00:00
|
|
|
--num-flaky-test-attempts=1
|
2020-11-23 15:19:16 +00:00
|
|
|
--timeout 45m
|
2021-01-27 21:51:24 +00:00
|
|
|
--client-details testType=$TEST_TYPE,testSuite=$TEST_CLASS,commitBranch=$CI_COMMIT_BRANCH,gitlabJobUrl=$CI_JOB_URL
|
2020-04-21 10:43:05 +00:00
|
|
|
|
2021-11-24 11:05:31 +00:00
|
|
|
|
|
|
|
firebase instrumentation tests:
|
|
|
|
stage: test
|
2021-11-24 11:36:55 +00:00
|
|
|
dependencies:
|
|
|
|
- build debug
|
2021-12-14 14:18:29 +00:00
|
|
|
except:
|
|
|
|
- schedules
|
2021-11-24 11:05:31 +00:00
|
|
|
tags:
|
2022-03-02 10:02:29 +00:00
|
|
|
- medium
|
2021-11-24 11:05:31 +00:00
|
|
|
script:
|
2022-03-02 10:02:29 +00:00
|
|
|
- curl https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz -o /tmp/google-cloud-sdk.tar.gz
|
2021-11-24 11:05:31 +00:00
|
|
|
- mkdir -p /opt
|
|
|
|
- tar zxf /tmp/google-cloud-sdk.tar.gz --directory /opt
|
|
|
|
- /opt/google-cloud-sdk/install.sh --quiet
|
|
|
|
- source /opt/google-cloud-sdk/path.bash.inc
|
|
|
|
- gcloud components update
|
|
|
|
- echo $CLOUD_PROJECT_ID_MAIL
|
|
|
|
- gcloud config set project $CLOUD_PROJECT_ID_MAIL
|
|
|
|
- echo $SERVICE_ACCOUNT_MAIL > /tmp/service-account.json
|
|
|
|
- gcloud auth activate-service-account --key-file /tmp/service-account.json
|
|
|
|
- gcloud firebase test android run
|
|
|
|
--app app/build/outputs/apk/beta/debug/ProtonMail-Android-${VERSION_NAME}-beta-debug.apk
|
|
|
|
--test app/build/outputs/apk/androidTest/beta/debug/ProtonMail-Android-${VERSION_NAME}-beta-debug-androidTest.apk
|
|
|
|
--type=instrumentation
|
2022-10-25 09:52:46 +00:00
|
|
|
--device model=Pixel2.arm,version=28
|
2021-11-24 11:05:31 +00:00
|
|
|
--test-targets "notPackage ch.protonmail.android.uitests"
|
|
|
|
--use-orchestrator
|
|
|
|
--num-flaky-test-attempts=1
|
|
|
|
--timeout 20m
|
|
|
|
|
2020-04-21 10:43:05 +00:00
|
|
|
include:
|
|
|
|
- project: 'translations/generator'
|
|
|
|
ref: master
|
|
|
|
file: '/jobs/sync-crowdin.gitlab-ci.yml'
|
|
|
|
|
|
|
|
- project: 'translations/generator'
|
|
|
|
ref: master
|
|
|
|
file: '/jobs/commit-locales.gitlab-ci.yml'
|
|
|
|
|
2021-03-01 17:12:36 +00:00
|
|
|
- project: 'translations/spellcheck'
|
|
|
|
ref: master
|
|
|
|
file: '/jobs/android.gitlab-ci.yml'
|
|
|
|
|
2020-04-21 10:43:05 +00:00
|
|
|
- project: 'agarroux/publish-github'
|
|
|
|
ref: master
|
|
|
|
file: '/jobs/release.gitlab-ci.yml'
|
|
|
|
|
2022-08-31 12:28:22 +00:00
|
|
|
- project: 'proton/mobile/android/proton-libs'
|
|
|
|
ref: main
|
|
|
|
file: '/ci/templates-shared/appetize-integration.yml'
|
2021-10-14 09:25:56 +00:00
|
|
|
|
|
|
|
startReview:
|
|
|
|
before_script:
|
|
|
|
- export VERSION_NAME=$(grep -E "versionName " buildSrc/src/main/kotlin/ProtonMail.kt | awk '{print $5}' | sed s/\"//g)
|
|
|
|
- export REVIEW_APP_ARTIFACT_PATH="app/build/outputs/apk/beta/debug/ProtonMail-Android-${VERSION_NAME}-beta-debug.apk"
|
|
|
|
- echo ${REVIEW_APP_ARTIFACT_PATH}
|
|
|
|
extends: .startReview
|
2021-12-14 14:18:29 +00:00
|
|
|
except:
|
|
|
|
- schedules
|
2021-10-14 09:25:56 +00:00
|
|
|
|
|
|
|
stopReview:
|
|
|
|
extends: .stopReview
|
|
|
|
rules:
|
|
|
|
# The cleanup is always manual on a Merge Request
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
|
|
when: manual
|
|
|
|
allow_failure: true
|
|
|
|
# But it's not needed when not on a Merge Request
|
|
|
|
- when: never
|
|
|
|
|
2020-04-21 10:43:05 +00:00
|
|
|
i18n-sync-crowdin:
|
|
|
|
stage: bot-i18n
|
2022-06-02 14:09:17 +00:00
|
|
|
needs: [ 'detekt analysis' ]
|
2020-04-21 10:43:05 +00:00
|
|
|
variables:
|
2020-12-31 10:18:21 +00:00
|
|
|
I18N_SYNC_CROWDIN_PROJECT: 'android-mail'
|
2020-04-21 10:43:05 +00:00
|
|
|
extends: .i18n-sync-crowdin-shared
|
2020-10-12 12:27:38 +00:00
|
|
|
except:
|
2022-06-02 14:09:17 +00:00
|
|
|
refs:
|
2022-07-15 12:47:07 +00:00
|
|
|
- pipelines
|
2022-06-02 14:09:17 +00:00
|
|
|
- schedules
|
2020-10-12 12:27:38 +00:00
|
|
|
variables:
|
|
|
|
- $TEST_TYPE == "feature" || $TEST_TYPE == "regression"
|
2020-04-21 10:43:05 +00:00
|
|
|
|
|
|
|
i18n-commit-locales:
|
|
|
|
stage: bot-i18n
|
|
|
|
variables:
|
2020-12-31 10:18:21 +00:00
|
|
|
I18N_COMMIT_CROWDIN_PROJECT: 'android-mail'
|
2020-04-21 10:43:05 +00:00
|
|
|
extends: .i18n-commit-locales-shared
|
2020-10-12 12:27:38 +00:00
|
|
|
except:
|
|
|
|
variables:
|
2020-12-31 10:18:21 +00:00
|
|
|
- $TEST_TYPE == "feature" || $TEST_TYPE == "regression"
|
2020-04-21 10:43:05 +00:00
|
|
|
|
|
|
|
release-publish-github:
|
2020-10-14 15:05:15 +00:00
|
|
|
stage: manual-release
|
2020-04-21 10:43:05 +00:00
|
|
|
when: 'manual'
|
|
|
|
variables:
|
|
|
|
RELEASE_SYNC_PUBLIC_URL: git@github.com:ProtonMail/proton-mail-android.git
|
|
|
|
RELEASE_SYNC_TO_BRANCH: 'release'
|
|
|
|
RELEASE_SYNC_FROM_BRANCH: 'release'
|
|
|
|
extends: .release-sync-commit-shared
|
2020-11-23 09:15:18 +00:00
|
|
|
tags:
|
2020-12-04 11:54:10 +00:00
|
|
|
- small
|
2020-04-21 10:43:05 +00:00
|
|
|
|
|
|
|
release-publish-github-tags:
|
2021-08-23 13:04:36 +00:00
|
|
|
stage: bot-release
|
|
|
|
when: 'manual'
|
2021-11-24 11:36:55 +00:00
|
|
|
dependencies:
|
|
|
|
- build release
|
2020-04-21 10:43:05 +00:00
|
|
|
variables:
|
|
|
|
RELEASE_SYNC_PUBLIC_URL: git@github.com:ProtonMail/proton-mail-android.git
|
|
|
|
RELEASE_SYNC_TO_BRANCH: 'release'
|
|
|
|
RELEASE_SYNC_FROM_BRANCH: 'release'
|
|
|
|
extends: .release-sync-tags-shared
|
2020-11-23 09:15:18 +00:00
|
|
|
tags:
|
2020-12-04 11:54:10 +00:00
|
|
|
- small
|
2020-12-18 08:51:22 +00:00
|
|
|
|
2020-06-04 15:26:14 +00:00
|
|
|
publish-github:
|
|
|
|
stage: bot-release
|
2021-11-24 11:36:55 +00:00
|
|
|
when: 'manual'
|
|
|
|
dependencies:
|
|
|
|
- build release
|
2020-06-04 15:26:14 +00:00
|
|
|
variables:
|
2020-12-31 10:18:21 +00:00
|
|
|
RELEASE_APP: android-mail
|
|
|
|
RELEASE_GITHUB_REPOSITORY: ProtonMail/proton-mail-android
|
|
|
|
RELEASE_GITHUB_BRANCH: 'release'
|
2020-06-04 15:26:14 +00:00
|
|
|
extends: .release-make-release
|
2020-11-23 09:15:18 +00:00
|
|
|
tags:
|
2020-12-04 11:54:10 +00:00
|
|
|
- small
|
2021-12-14 14:18:29 +00:00
|
|
|
|
2021-11-25 09:00:36 +00:00
|
|
|
check for fixups:
|
2022-02-17 14:53:49 +00:00
|
|
|
stage: fixups
|
2021-11-25 09:00:36 +00:00
|
|
|
script:
|
|
|
|
- git fetch origin $CI_COMMIT_BRANCH
|
|
|
|
- git fetch origin develop
|
2021-12-14 14:18:29 +00:00
|
|
|
- git log --pretty=%s "origin/develop..origin/$CI_COMMIT_BRANCH" | awk '$0 ~ /^fixup/ {find = 1}; END { exit find }'
|
|
|
|
except:
|
2022-01-18 12:06:44 +00:00
|
|
|
- schedules
|