Skip to content

Commit

Permalink
Merge pull request #218 from nimblehq/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
suho authored Oct 29, 2021
2 parents 0ef655d + d8002d0 commit 4e3cee4
Show file tree
Hide file tree
Showing 70 changed files with 698 additions and 101 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "Bug Report"
about: "You found something that is not working. Report it so that it can be fixed. 👷‍"
title: "Fix: "
labels: "type : bug"
---

## Issue

Describe the issue you are facing. Show us the implementation: screenshots, gif, etc.

## Expected

Describe what should be the correct behaviour.

## Steps to reproduce

1.
2.
3.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/chore_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "Chore"
about: "Open a Chore for minor update."
title: "Update "
labels: "type : chore"
---

## Why

Describe the update details and why it's needed.

## Who Benefits?

Describe who will be the beneficiaries e.g. everyone, specific chapters, clients...
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "Feature"
about: "Open a feature issue to add new functionalities."
title: "Add "
labels: "type : feature"
---

## Why

Describe the big picture of the feature and why it's needed.

## Who Benefits?

Describe who will be the beneficiaries e.g. everyone, specific chapters, clients...
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/story_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: "Story"
about: "Open a feature story"
title: "[Type] As a user, I can "
labels: "type : feature"
---

## Why

Describe the idea of the user story as in what the motive of the user story is.

## Acceptance Criteria

List down how the user story will be tested and what criteria are necessary for the user story to be accepted.

## Design

(Optional) Add design screenshots or Figma links for UI/UX-related stories.

## Resources

(Optional) Add useful resources such as links to documentation, implementation ideas, or best practices.
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
name: test
name: Automatic pull request review

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

jobs:
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Run SwiftLint
uses: norio-nomura/[email protected]
with:
args: --strict

Test:
name: Test
review_pull_request:
name: Pull request review by Danger
runs-on: macOS-latest
steps:
- name: Cancel Previous Runs
Expand All @@ -29,12 +15,19 @@ jobs:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
# Set fetch-depth (default: 1) to get whole tree
with:
fetch-depth: 0


- uses: actions/cache@v2
id: bunlderCache
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle install
run: bundle install
run: bundle install --path vendor/bundle

- name: Cache Pods
uses: actions/cache@v2
Expand All @@ -47,7 +40,16 @@ jobs:
- name: Install Pods Dependencies
run: bundle exec pod install
shell: bash

- name: Build and Test
run: bundle exec fastlane build_and_test
env:
CI: true

- name: Export code coverage report
run: bundle exec fastlane run_xcov

- name: Review pull request by Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger
30 changes: 30 additions & 0 deletions .github/workflows/test_install_script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test Install Script

on:
push:
branches: [ feature/**, bug/**, chore/** ]

jobs:
Test:
name: Test
runs-on: macOS-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Bundle install
run: bundle install

- name: Start Install Script for Template App
run: sh make.sh --bundle-id co.nimblehq.template --bundle-id-staging co.nimblehq.template.staging --project-name TemplateApp

- name: Build and Test
run: bundle exec fastlane build_and_test
env:
CI: true
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
fastlane/xcov_output

# Sourcery
*.generated.swift
*.generated.swift

# Derived Data folder
DerivedData

# Tuist
.tuist-generated
6 changes: 3 additions & 3 deletions .sourcery.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
sources:
- ProjectName/Sources
- {PROJECT_NAME}/Sources
templates:
- tools/sourcery/templates
output:
ProjectNameTests/Sources/Mocks/Sourcery
{PROJECT_NAME}Tests/Sources/Mocks/Sourcery
args:
autoMockableTestableImports:
- ProjectName
- {PROJECT_NAME}
autoMockableImports:
- RxSwift
- RxCocoa
11 changes: 11 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# file options
--exclude Pods, Generated, **/*.generated.swift

# rules
--disable fileHeader
--disable initCoderUnavailable
--disable trailingCommas
--disable wrapEnumCases
--disable wrapMultilineStatementBraces
--disable wrapSwitchCases
--disable blankLinesAtStartOfScope
9 changes: 7 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
included:
- {PROJECT_NAME}
- {PROJECT_NAME}Tests
- {PROJECT_NAME}UITests

excluded:
- ProjectNameTests/Sources/Mocks/Sourcery/AutoMockable.generated.swift
- ProjectName/Sources/Supports/Helpers/R.swift/R.generated.swift
- {PROJECT_NAME}Tests/Sources/Mocks/Sourcery/AutoMockable.generated.swift
- {PROJECT_NAME}/Sources/Supports/Helpers/R.swift/R.generated.swift
- Pods
- Derived
- DerivedData
Expand Down
34 changes: 34 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: true

require './fastlane/Constants/Constants'

# Warn when there is a big PR
warn("This pull request is quite big (#{git.lines_of_code} lines changed), please consider splitting it into multiple pull requests.") if git.lines_of_code > 500

# Warn to encourage that labels should have been used on the PR
warn("This pull request doesn't have any labels, please consider to add labels to this pull request.") if github.pr_labels.empty?

# SwiftFormat
swiftformat.binary_path = './Pods/SwiftFormat/CommandLineTool/swiftformat'
swiftformat.exclude = %w(Pods/** **/*generated.swift)
swiftformat.check_format

# Swiftlint
swiftlint.binary_path = './Pods/SwiftLint/swiftlint'
swiftlint.config_file = '.swiftlint.yml'
swiftlint.max_num_violations = 20
swiftlint.lint_files(
inline_mode: true,
fail_on_error: true,
additional_swiftlint_args: '--strict'
)

xcresultPath = "#{Constants.TEST_OUTPUT_DIRECTORY_PATH}/#{Constants.TESTS_SCHEME}.xcresult"

# Xcode summary
xcode_summary.ignored_files = 'Pods/**'
xcode_summary.inline_mode = true
xcode_summary.report xcresultPath

# Upload the report of the code coverage of the files changed in a pull request
markdown File.read("#{Constants.XCOV_OUTPUT_DIRECTORY_PATH}/report.md")
10 changes: 9 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
source "https://rubygems.org"

gem "fastlane"
gem "cocoapods"
gem "fastlane"
gem "xcov"
gem "danger"
gem "danger-swiftlint"
gem "danger-xcode_summary"
gem 'danger-swiftformat'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
10 changes: 6 additions & 4 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '10.0'
platform :ios, '11.0'
use_frameworks!

def testing_pods
Expand All @@ -7,9 +7,10 @@ def testing_pods
pod 'RxNimble', subspecs: ['RxBlocking', 'RxTest']
pod 'RxSwift'
pod 'Sourcery'
pod 'SwiftFormat/CLI'
end

target 'ProjectName' do
target '{PROJECT_NAME}' do
# UI
pod 'Kingfisher'
pod 'SnapKit'
Expand All @@ -28,17 +29,18 @@ target 'ProjectName' do
pod 'IQKeyboardManagerSwift'
pod 'NimbleExtension', :git => 'https://github.com/nimblehq/NimbleExtension', :branch => 'master'
pod 'R.swift'
pod 'Resolver' # Needs Cocoapods on iOS 11 to support Resolver

# Development
pod 'SwiftLint'
pod 'Wormholy', :configurations => ['Debug Staging', 'Debug Production']

target 'ProjectNameTests' do
target '{PROJECT_NAME}Tests' do
inherit! :search_paths
testing_pods
end

target 'ProjectNameUITests' do
target '{PROJECT_NAME}UITests' do
testing_pods
end
end
Expand Down
10 changes: 5 additions & 5 deletions Project.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.project(name: "ProjectName")
let project = Project.project(name: "{PROJECT_NAME}", bundleId: "{BUNDLE_ID_PRODUCTION}")

extension Project {

static func project(name: String) -> Project {
static func project(name: String, bundleId: String) -> Project {
return Project(
name: name,
organizationName: "Nimble",
Expand All @@ -14,9 +14,9 @@ extension Project {
.map { $0.createConfiguration(projectName: name) }
),
targets: [
Target.mainTarget(name: name),
Target.testsTarget(name: name),
Target.uiTestsTarget(name: name)
Target.mainTarget(name: name, bundleId: bundleId),
Target.testsTarget(name: name, bundleId: bundleId),
Target.uiTestsTarget(name: name, bundleId: bundleId)
],
schemes: [
Scheme.productionScheme(name: name),
Expand Down
Empty file.
Empty file.
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,9 @@ Documentation : [Tuist Official Documents](https://docs.tuist.io/tutorial/get-st

## How to use

### Install Script

1. Change the project name at line 3 in `Project.swift`

```swift
let project = Project.project(name: "ios-template")
```
to:
```swift
let project = Project.project(name: "<Your Project Name>")
```

2. Execute the following command:

```bash
tuist generate
```
The command `tuist generate` will generate your project files, folders and two important files `*.xcodeproj` and `*.xcworkspace`.
Execute the following command
```
sh make.sh --bundle-id [BUNDLE_ID_PRODUCTION] --bundle-id-staging [BUNDLE_ID_STAGING] --project-name [PROJECT_NAME]
```
4 changes: 3 additions & 1 deletion Tuist/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import ProjectDescription

let config = Config(
generationOptions: [
.disableAutogeneratedSchemes
.disableAutogeneratedSchemes,
.disableSynthesizedResourceAccessors,
.disableBundleAccessors
]
)
Loading

0 comments on commit 4e3cee4

Please sign in to comment.