Skip to content
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
192 changes: 7 additions & 185 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,195 +1,17 @@
version: 2.1
references:
workspace: &workspace
~/src

android_config: &android_config
working_directory: *workspace
docker:
- image: circleci/android:api-30
environment:
TERM: dumb
_JAVA_OPTIONS: "-Xmx2048m -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m"'

gradle_key: &gradle_key
jars-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

gem_key: &gems_key
gems-{{ checksum "Gemfile.lock" }}

restore_gradle_cache: &restore_gradle_cache
restore_cache:
key: *gradle_key

restore_gems_cache: &restore_gems_cache
restore_cache:
key: *gems_key

save_gradle_cache: &save_gradle_cache
save_cache:
key: *gradle_key
paths:
- ~/.gradle
- ~/.m2

save_gems_cache: &save_gems_cache
save_cache:
key: *gems_key
paths:
- vendor/bundle

ruby_dependencies: &ruby_dependencies
run:
name: Download Ruby Dependencies
command: |
gem install bundler
bundle check || bundle install --path vendor/bundle
android_dependencies: &android_dependencies
run:
name: Download Android Dependencies
command: ./gradlew androidDependencies

decode_android_key: &decode_android_key
run:
name: Decode Android key store
command: echo $BASE_64_KEYSTORE | base64 -d | tee debug.keystore app/debug.keystore > /dev/null

create_keystore_properties: &create_keystore_properties
run:
name: Create keystore.properties
command: printf 'keyAlias=%s\nkeyPassword=%s\nkeyStore=%s\nstorePassword=%s' \
$KEY_ALIAS $KEY_PASSWORD $KEYSTORE $STORE_PASSWORD > keystore.properties

create_google_play_key: &create_google_play_key
run:
name: Create Google Play Key
command: echo $GOOGLE_PLAY_KEY > google-play-key.json

jobs:

test_unit:
<<: *android_config

steps:
- checkout
- *restore_gradle_cache
- *restore_gems_cache
- *ruby_dependencies
- *create_keystore_properties
- *decode_android_key
- *android_dependencies
- *save_gradle_cache
- *save_gems_cache

- run:
name: Run unit tests
command: ./gradlew pinwheel-android:test

- store_artifacts:
path: app/build/reports/
destination: /reports/

- store_artifacts:
path: pinwheel-android/build/reports/
destination: /reports/

- store_test_results:
path: app/build/test-results/

- store_test_results:
path: pinwheel-android/build/test-results/

test_ui:
<<: *android_config

steps:
- checkout
- *restore_gradle_cache
- *restore_gems_cache
- *ruby_dependencies
- *create_keystore_properties
- *decode_android_key
- *android_dependencies
- *save_gradle_cache
- *save_gems_cache

- run:
name: Run UI tests
command: bundle exec fastlane aws_device_run_android # Run ui tests using Fastlane

- store_artifacts:
path: app/build/reports/
destination: /reports/

- store_artifacts:
path: pinwheel-android/build/reports/
destination: /reports/

- store_test_results:
path: app/build/test-results/

- store_test_results:
path: pinwheel-android/build/test-results/

github_publish:
<<: *android_config

steps:
- checkout
- *restore_gradle_cache
- *restore_gems_cache
- *ruby_dependencies
- *create_keystore_properties
- *decode_android_key
- *android_dependencies
- *save_gradle_cache
- *save_gems_cache

- run:
name: Assemble release
command: ./gradlew clean assembleRelease
- run:
name: Publish to GitHub
command: ./gradlew publish

github_release:
working_directory: *workspace
build_and_prepare:
docker:
- image: cimg/go:1.16.3
- image: cimg/base:stable
steps:
- checkout
- run:
name: "Install ghr"
command: |
go get github.com/tcnksm/ghr
- run:
name: "Publish Release on GitHub"
command: |
VERSION=$(cat pinwheel-android/build.gradle | grep 'def libraryVersion' | cut -d"'" -f 2)
echo ${VERSION}
ghr -t ${GPR_API_KEY} -delete ${VERSION} .
name: Done
command: echo Done

workflows:
version: 2
workflow:
master-workflow:
jobs:
- test_unit

- test_ui

- github_publish:
filters:
branches:
only:
- release
requires:
- test_unit

- github_release:
filters:
branches:
only:
- release
requires:
- test_unit
- build_and_prepare:
context: 'frontend-production'
20 changes: 1 addition & 19 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,4 @@
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Related issues

> Fix [#1]()

## Checklists

### Development

- [ ] Lint rules pass locally
- [ ] The code changed/added as part of this pull request has been covered with tests
- [ ] All tests related to the changed code pass in development

### Code review

- [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
- [ ] "Ready for review" label attached to the PR and reviewers mentioned in a comment
- [ ] Changes have been reviewed by at least one other engineer
- [ ] Issue from task tracker has a link to this pull request
- [ ] Other
110 changes: 2 additions & 108 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,112 +1,6 @@
*.iml
.gradle
/local.properties
/keystore.properties
/private_key.pepk
.idea/*
.DS_Store
/build
/captures
.externalNativeBuild
### Java template
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar

# include libs jars
!/app/libs/**

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

### Android template
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex


# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Keystore files
*.jks

# Freeline
freeline.py
freeline/
freeline_project_description.json

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties


app/libs/\.DS_Store
debug.keystore
github.properties
app/keystore.properties
env-vars.sh

# Fastlane
fastlane/report.xml

.vscode

# Phylum Integration
.phylum_project
.tmp*
pinwheel-android-sdk
6 changes: 0 additions & 6 deletions Gemfile

This file was deleted.

Loading