Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup semaphore #28

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 6 additions & 74 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,15 @@
version: v1.0
name: Verification Pipeline
name: Android
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
containers:
- name: main
image: 'registry.semaphoreci.com/android:29'

auto_cancel:
running:
when: "true"

global_job_config:
env_vars:
- name: ADB_INSTALL_TIMEOUT
value: "10"
secrets:
- name: android_keys
prologue:
commands:
- checkout
- mv ~/release-keystore.jks ~/$SEMAPHORE_GIT_DIR/app/release-keystore.jks
- cache restore gradle-wrapper
- cache restore gradle-cache
- cache restore android-build

blocks:
- name: 'Build'
skip:
when: "(branch != 'master' OR branch != 'dev') AND pull_request !~ '.*'"
- name: Gradle
task:
jobs:
- name: 'Build Project'
- name: Build
commands:
- ./gradlew bundle
epilogue:
on_pass:
commands:
- cache clear
- cache store gradle-wrapper ~/.gradle/wrapper
- cache store gradle-cache ~/.gradle/caches
- cache store android-build ~/.android/build-cache

- name: 'Verification'
skip:
when: "pull_request !~ '.*'"
task:
jobs:
- name: 'Analyze Code'
commands:
- ./gradlew lint
- name: 'Unit Tests'
commands:
- ./gradlew test
- name: 'Integration Tests'
commands:
- sdkmanager "platform-tools" "platforms;android-29" "build-tools;30.0.0" "emulator"
- sdkmanager "system-images;android-29;google_apis;x86"
- echo no | avdmanager create avd -n test-emulator -k "system-images;android-29;google_apis;x86"
- emulator -avd test-emulator -noaudio -no-boot-anim -gpu off -no-window &
- adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
- adb shell wm dismiss-keyguard
- sleep 1
- adb shell settings put global window_animation_scale 0
- adb shell settings put global transition_animation_scale 0
- adb shell settings put global animator_duration_scale 0
- ./gradlew connectedAndroidTest
epilogue:
always:
commands:
- artifact push job --expire-in 2w --destination reports/ app/build/reports/

promotions:
- name: Internal Deploy
pipeline_file: deploy-internal.yml
auto_promote:
when: "result = 'passed' AND branch = 'dev'"
- name: Beta Deploy
pipeline_file: deploy-beta.yml
auto_promote:
when: "result = 'passed' AND branch = 'master'"
- checkout
- sem-version java 1.8
- ./gradlew build
Binary file added semaphore-demo-android-1.0.tar.gz
Binary file not shown.