protoncore_android/.gitlab-ci.yml

223 lines
4.4 KiB
YAML
Raw Normal View History

image: ${CI_REGISTRY}/protonvpn/android/android-app-new:branch-compose
include:
- project: 'agarroux/publish-github'
ref: master
file: '/jobs/release.gitlab-ci.yml'
- 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-10-26 11:57:49 +00:00
- project: 'ProtonVPN/android/android-app-new'
ref: development
file: '/appetize-integration.yml'
stages:
- bot
- analyze
- build
- test
- report
- publish
- commit
- slackRelease
variables:
# Use fastzip to improve cache times
FF_USE_FASTZIP: "true"
# Output upload and download progress every 5 seconds
TRANSFER_METER_FREQUENCY: "5s"
# Use no compression for artifacts
2021-11-04 13:05:04 +00:00
ARTIFACT_COMPRESSION_LEVEL: "fastest"
# Use low compression for caches
CACHE_COMPRESSION_LEVEL: "fast"
2021-11-04 13:05:04 +00:00
cache: &global_cache
key: ${CI_COMMIT_REF_SLUG}
paths:
- .gradle/caches/modules-*
- .gradle/caches/jars-*
- ./**/build
#####################
2021-10-29 14:52:34 +00:00
danger-review:
image: ruby:2.7
2021-11-04 13:05:04 +00:00
stage: .post
2021-10-29 14:52:34 +00:00
when: always
tags:
- small
script:
- bundle config set path 'vendor/ruby'
- bundle config set without 'production'
- bundle install
- bundle exec danger --fail-on-errors=false
2021-10-29 14:52:34 +00:00
cache:
key:
files:
- Gemfile.lock
paths:
- vendor/ruby
2021-11-04 13:05:04 +00:00
allow_failure: true
2021-10-29 14:52:34 +00:00
variables:
DANGER_GITLAB_API_TOKEN: $DANGER_GITLAB_API_TOKEN
interruptible: true
2021-11-04 13:05:04 +00:00
detekt analyze:
stage: analyze
when: always
tags:
- medium
2021-11-04 13:05:04 +00:00
interruptible: true
script:
- ./gradlew multiModuleDetekt
artifacts:
expire_in: 1 month
reports:
codequality: config/detekt/reports/mergedReport.json
assemble:
stage: build
tags:
- large
2021-11-04 13:05:04 +00:00
interruptible: true
script:
2021-10-26 11:57:49 +00:00
- echo PROXY_TOKEN="$(curl -o - https://proxy.proton.black/token/get)" >> local.properties
- echo HOST="proton.black" >> local.properties
2021-11-04 13:05:04 +00:00
- ./gradlew assembleDebug
2021-10-26 11:57:49 +00:00
artifacts:
paths:
- coreexample/build/outputs/
debugTests:
stage: test
tags:
- large
2021-11-04 13:05:04 +00:00
interruptible: true
script:
- ./gradlew -Pci --console=plain allTest
2021-10-25 10:06:58 +00:00
uiTests:
stage: test
when: manual
trigger:
strategy: depend
include:
- local: coreexample/ci/test.coreexample.uitests.yml
release-publish-github:
stage: publish
2020-12-18 16:04:16 +00:00
tags:
- small
only:
- master
variables:
RELEASE_SYNC_PUBLIC_URL: git@github.com:ProtonMail/protoncore_android.git
RELEASE_SYNC_TO_BRANCH: 'master'
RELEASE_SYNC_FROM_BRANCH: 'master'
extends: .release-sync-commit-shared
publishMaven:
stage: publish
tags:
- large
script:
- ./gradlew publishNewRelease --no-daemon --no-parallel
only:
- master
artifacts:
expire_in: 10 days
paths:
- new_releases.tmp
- releases
- docs
- README.md
publishGradlePortal:
stage: publish
tags:
- large
script:
- ./gradlew -p plugins assemble && ./gradlew -p plugins publishAll
only:
- master
artifacts:
expire_in: 10 days
paths:
- new_releases.tmp
- releases
- docs
- README.md
commitRelease:
stage: commit
2020-12-18 16:04:16 +00:00
tags:
- small
needs:
- job: publishMaven
artifacts: true
script:
- ./util/commitRelease
only:
- master
postReleaseToSlack:
stage: slackRelease
2020-12-18 16:04:16 +00:00
tags:
- small
needs:
- job: publishMaven
artifacts: true
script:
- ./util/postReleaseToSlack
only:
- master
i18n-sync-crowdin:
extends: .i18n-sync-crowdin-common
variables:
I18N_SYNC_CROWDIN_PROJECT: 'android-core'
I18N_SYNC_BRANCH: 'master'
I18N_FILTER_OUT_ITEMS: 'coreexample'
i18n-commit-locales:
extends: .i18n-commit-locales-shared
variables:
I18N_COMMIT_CROWDIN_PROJECT: 'android-core'
I18N_COMMIT_BRANCH_PUSH: 'master'
I18N_COMMIT_BRANCH_ALLOWED: 'master'
2021-10-26 11:57:49 +00:00
startReview:
before_script:
- export REVIEW_APP_ARTIFACT_PATH="coreexample/build/outputs/apk/debug/coreexample-debug.apk"
extends: .startReview
2021-11-04 13:05:04 +00:00
stage: test
2021-10-26 11:57:49 +00:00
stopReview:
extends: .stopReview
coverage report:
stage: report
tags:
- medium
script:
- ./gradlew coberturaCoverageReport
coverage: /Total.*?(\d{1,3}\.\d{0,2})%/
allow_failure: true
2021-11-04 13:05:04 +00:00
interruptible: true
cache:
<<: *global_cache
policy: pull
artifacts:
expire_in: 1 week
paths:
- ./build/reports/*
reports:
cobertura:
2021-11-04 13:05:04 +00:00
- ./build/reports/cobertura-coverage.xml