generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from nimblehq/release/0.1.0
Release - 0.1.0
- Loading branch information
Showing
278 changed files
with
27,322 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Team | ||
# @phongvhd93 is the Team Lead | ||
* @suho @luongvo @phongvhd93 @markgravity @lydiasama @AVI5HEK @kaungkhantsoe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
Link to the milestone on Github e.g. https://github.com/nimblehq/git-templates/milestone/41?closed=1 | ||
or | ||
Link to the project management tool for the release | ||
https://github.com/nimblehq/kmm-templates/milestone/? | ||
|
||
## Features | ||
|
||
Provide the ID and title of the issue in the section for each type (feature, chore and bug). The link is optional. | ||
|
||
- [sc-1234] As a user, I can log in | ||
or | ||
- [[sc-1234](https://app.shortcut.com/nimblehq/story/1234)] As a user, I can log in | ||
- # | ||
|
||
## Chores | ||
- Same structure as in ## Feature | ||
|
||
- # | ||
|
||
## Bugs | ||
- Same structure as in ## Feature | ||
|
||
- # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
name: Code analysis, test and generate sample project | ||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
generate_sample: | ||
name: Generate the sample project | ||
runs-on: macos-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
submodules: "recursive" | ||
|
||
# To avoid code change in git when refreshing the "sample" project | ||
- name: Preserve the ArkanaKeys | ||
run: mv -f ./sample/ios/ArkanaKeys ../ | ||
|
||
- name: Remove the old sample project | ||
run: rm -rf sample | ||
|
||
- name: Generate the new sample project | ||
run: ./make.sh --bundle-id co.nimblehq.kmm.template --bundle-id-staging co.nimblehq.kmm.template.staging --project-name sample --ios-version 14.0 | ||
|
||
- name: Restore the previous ArkanaKeys's keys | ||
run: | | ||
rm -rf ./sample/ios/ArkanaKeys | ||
mv -f ../ArkanaKeys ./sample/ios | ||
- id: changes | ||
name: Check for changes in the sample project | ||
run: | | ||
count=$(git status sample --porcelain | wc -l) | ||
echo "count=$count" >> $GITHUB_OUTPUT | ||
- name: Commit & push the sample project changes | ||
if: steps.changes.outputs.count > 0 | ||
run: | | ||
git config user.name team-nimblehq | ||
git config user.email [email protected] | ||
git add sample | ||
git commit -m "[Chore] Generate & update sample project" | ||
git push | ||
android_test: | ||
needs: [generate_sample] | ||
name: Run Android code analysis and tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
defaults: | ||
run: | ||
working-directory: ./sample | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- 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: Decode buildKonfig properties | ||
run: echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties | ||
|
||
- name: Run Detekt | ||
run: ./gradlew detekt | ||
|
||
- name: Run Lint | ||
run: ./gradlew lint | ||
|
||
- name: Run unit tests with Kover | ||
run: ./gradlew koverXMLReport | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.7' | ||
bundler-cache: true | ||
|
||
- name: Run Danger to wrap up the review | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
bundle install | ||
bundle exec danger --danger_id=danger_android | ||
ios_test: | ||
needs: [generate_sample] | ||
name: Run iOS code analysis and tests | ||
runs-on: macos-latest | ||
defaults: | ||
run: | ||
working-directory: ./sample/ios | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v3 | ||
id: bunlderCache | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Bundle install | ||
run: bundle install | ||
|
||
- name: Cache Pods | ||
uses: actions/cache@v3 | ||
id: cocoapodCache | ||
with: | ||
path: Pods | ||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pods- | ||
- name: Decode buildKonfig properties | ||
working-directory: ./sample | ||
run: echo ${{ secrets.BUILD_KONFIG_PROPERTIES }} | base64 --decode > buildKonfig.properties | ||
|
||
- name: Generate KMM frameworks for Cocoapods | ||
run: | | ||
cd .. | ||
./gradlew generateDummyFramework | ||
- name: Install Pods Dependencies | ||
run: bundle exec pod install | ||
|
||
- name: Build and Test | ||
run: bundle exec fastlane buildAndTest | ||
env: | ||
CI: true | ||
|
||
- name: Clean up previous code coverage report | ||
run: bundle exec fastlane cleanUpOutput | ||
|
||
- name: __Workaround__ Running Danger SwiftFormat from non-root directory | ||
run: | | ||
# Find the path of danger_swiftformat | ||
danger_swiftformat_path=$(echo "$(gem which danger_swiftformat)" | sed 's/\/danger_swiftformat.rb//') | ||
echo $danger_swiftformat_path | ||
# Insert a map operator in the "find_swift_files" method to remove "sample/ios/" prefix from all files. | ||
sed -i '' "s/.uniq/.uniq.map { |file| file.partition('sample\/ios\/').last }/g" "$danger_swiftformat_path/swiftformat/plugin.rb" | ||
- name: Run Danger to wrap up the review | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: bundle exec danger --danger_id=danger_ios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "ios"] | ||
path = ios | ||
url = https://github.com/nimblehq/ios-templates.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Welcome to the KMM Templates contributing guide <!-- omit in toc --> | ||
|
||
Thank you for investing your time in contributing to our project! :sparkles: | ||
|
||
## Getting started | ||
|
||
### Git Submodules | ||
|
||
- To add a submodule with default source branch (develop/main) | ||
``` | ||
$ git submodule add <repository> <path> | ||
``` | ||
For example, | ||
``` | ||
$ git submodule add [email protected]:nimblehq/android-templates.git android | ||
``` | ||
- To add a submodule with a specific source branch | ||
``` | ||
$ git submodule add -b <branch> <repository> <path> | ||
``` | ||
For example, | ||
``` | ||
$ git submodule add -b feature/kmm-support-upgrade-to-gradle-8 [email protected]:nimblehq/android-templates.git android | ||
``` | ||
- To remove a submodule | ||
``` | ||
$ git rm android | ||
``` | ||
Also, remove the cached repository of the submodule at `.git/modules/` if nescessary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 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/lint-result.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 for templates | ||
# Report coverage of modified files, warn if total project coverage is under 80% | ||
# or if any modified file's coverage is under 95% | ||
kover_file = "android/build/reports/kover/report.xml" | ||
markdown "## Kover report:" | ||
shroud.reportKover "Unit Tests", kover_file, 80, 95, false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
gem 'danger' | ||
gem 'danger-android_lint' | ||
gem 'danger-commit_lint' | ||
gem 'danger-kotlin_detekt' | ||
gem 'danger-shroud' |
Oops, something went wrong.