Skip to content

Commit

Permalink
Merge pull request #47 from luongvo/release/0.1.0
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
luongvo authored Dec 8, 2022
2 parents 4feaf82 + 39bef4d commit a0e810f
Show file tree
Hide file tree
Showing 168 changed files with 3,672 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# @luongvo is the owner and the others are code reviewers
* @suho @blyscuit @doannimble @manh-t
8 changes: 6 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

## What happened 👀

Provide a description of the **changes** this pull request brings to the codebase. Additionally, when the pull request is still being worked on, a checklist of the planned changes is welcome to track progress.
Provide a description of the **changes** this pull request brings to the codebase. Additionally, when the pull request
is still being worked on, a checklist of the planned changes is welcome to track progress.

## Insight 📝

Describe in detail why this solution is the most appropriate, which solution you tried but did not go with, and how to test the changes. References to relevant documentation are welcome as well.
Describe in detail why this solution is the most appropriate, which solution you tried but did not go with, and how to
test the changes. References to relevant documentation are welcome as well.

## Proof Of Work 📹

Show us the implementation: screenshots, GIFs, etc.

<img src="URL_GOES_HERE" width=300 />
71 changes: 71 additions & 0 deletions .github/workflows/android_deploy_production_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Android - Deploy Production build to Firebase

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy_android_production_to_firebase:
name: Deploy android production to Firebase
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- name: Checkout source code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup BuildKonfig Properties
env:
BUILD_KONFIG_PROPERTIES: ${{ secrets.BUILD_KONFIG_PROPERTIES }}
run: |
echo $BUILD_KONFIG_PROPERTIES | base64 --decode > buildKonfig.properties
- name: Setup Google Services
env:
ANDROID_PRODUCTION_GOOGLE_SERVICES_JSON: ${{ secrets.ANDROID_PRODUCTION_GOOGLE_SERVICES_JSON }}
run: |
mkdir -p android/src/production
echo $ANDROID_PRODUCTION_GOOGLE_SERVICES_JSON > android/src/production/google-services.json
- name: Setup Android release signing
env:
ANDROID_RELEASE_KEYSTORE: ${{ secrets.ANDROID_RELEASE_KEYSTORE }}
ANDROID_SIGNING_PROPERTIES: ${{ secrets.ANDROID_SIGNING_PROPERTIES }}
run: |
echo $ANDROID_RELEASE_KEYSTORE | base64 --decode > config/release.keystore
echo $ANDROID_SIGNING_PROPERTIES | base64 --decode > signing.properties
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: chkfung/[email protected]
with:
gradlePath: android/build.gradle.kts
versionCode: ${{ github.run_number }}

- name: Build Production release APK
run: ./gradlew assembleProductionRelease

- name: Deploy staging to Firebase
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: '1:835959262689:android:cfc4c7eb6425a49c0896a0'
serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }}
groups: nimble
file: android/build/outputs/apk/production/release/android-production-release.apk
56 changes: 56 additions & 0 deletions .github/workflows/android_deploy_staging_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Android - Deploy Staging build to Firebase

on:
push:
branches:
- develop
workflow_dispatch:

jobs:
deploy_android_staging_to_firebase:
name: Deploy android staging to Firebase
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- name: Checkout source code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup BuildKonfig Properties
env:
BUILD_KONFIG_PROPERTIES: ${{ secrets.BUILD_KONFIG_PROPERTIES }}
run: |
echo $BUILD_KONFIG_PROPERTIES | base64 --decode > buildKonfig.properties
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: chkfung/[email protected]
with:
gradlePath: android/build.gradle.kts
versionCode: ${{ github.run_number }}

- name: Build Staging APK
run: ./gradlew assembleStagingDebug

- name: Deploy staging to Firebase
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: '1:835959262689:android:d9b8f785d7bf477a0896a0'
serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }}
groups: nimble
file: android/build/outputs/apk/staging/debug/android-staging-debug.apk
64 changes: 64 additions & 0 deletions .github/workflows/review_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Review pull request

on:
pull_request:
types: [ opened, reopened, edited, synchronize, ready_for_review ]

jobs:
review_pull_request:
name: Review pull request
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- name: Checkout source code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup BuildKonfig Properties
env:
BUILD_KONFIG_PROPERTIES: ${{ secrets.BUILD_KONFIG_PROPERTIES }}
run: |
echo $BUILD_KONFIG_PROPERTIES | base64 --decode > buildKonfig.properties
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Detekt
run: ./gradlew detekt

- name: Run Lint
run: ./gradlew lintStagingDebug

- name: Run unit tests with Kover
run: ./gradlew koverMergedXmlReport

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true

- name: Run Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,22 @@

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# Shared
*.iml
.gradle
.DS_Store
build
captures
.externalNativeBuild
.cxx
local.properties
xcuserdata

# Android
# Google services
google-services.json
# Keystore
config/release.keystore

# iOS
39 changes: 39 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if github.pr_title.include? "WIP"

# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

# Warn to encourage a PR description
warn("Please provide a summary in the PR description to make it easier to review") if github.pr_body.length == 0

# Warn to encourage that labels should have been used on the PR
warn("Please add labels to this PR") if github.pr_labels.empty?

# Check commits lint and warn on all checks (instead of failing)
commit_lint.check warn: :all, disable: [:subject_length]

# Detekt output check
detekt_dir = "build/reports/detekt/detekt.xml"
Dir[detekt_dir].each do |file_name|
kotlin_detekt.skip_gradle_task = true
kotlin_detekt.report_file = file_name
kotlin_detekt.detekt(inline_mode: true)
end

# Android Lint output check
lint_dir = "**/build/reports/lint-results-stagingDebug.xml"
Dir[lint_dir].each do |file_name|
android_lint.skip_gradle_task = true
android_lint.report_file = file_name
android_lint.lint(inline_mode: true)
end

# Show Danger test coverage report from Kover
kover_dir = "build/reports/kover/merged/xml/report.xml"
Dir[kover_dir].each do |file_name|
# Report coverage of modified files, warn if total project coverage is under 80%
# or if any modified file's coverage is under 95%
module_name = file_name.split('/', 2)[0]
shroud.reportKover module_name, file_name, 80, 95, false
end
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# Android
gem 'danger'
gem 'danger-android_lint'
gem 'danger-commit_lint'
gem 'danger-kotlin_detekt'
gem 'danger-shroud'
Loading

0 comments on commit a0e810f

Please sign in to comment.