Skip to content

Commit

Permalink
feat(#173): Regenerate project
Browse files Browse the repository at this point in the history
Signed-off-by: Ryne Cheow <[email protected]>
  • Loading branch information
rynecheow committed May 24, 2020
1 parent 9d569ac commit a90c029
Show file tree
Hide file tree
Showing 168 changed files with 6,459 additions and 6,359 deletions.
66 changes: 0 additions & 66 deletions .circleci/config.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build pipeline

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Resolve dependencies
run: |
brew bundle
# - name: Danger
# run: |
# danger-swift ci
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Restore SPM Cache
uses: actions/cache@v1
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build and test (SPM)
run: |
swift build
swift test
- name: Generate Xcodeproj
run: |
xcodegen
- name: Restore Carthage Cache
uses: actions/cache@v1
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
${{ runner.os }}-carthage-
- name: Resolving Carthage dependencies
run: |
carthage update --cache-builds --new-resolver --configuration Debug
- name: Testing "RxAlamofire iOS" on Swift 5.1
run: |
xcodebuild test SWIFT_VERSION=5.1 -scheme 'RxAlamofire iOS' -project 'RxAlamofire.xcodeproj' -sdk iphonesimulator -destination "platform=iOS simulator,name=iPhone 11"
- name: Testing "RxAlamofire tvOS" on Swift 5.1
run: |
xcodebuild test SWIFT_VERSION=5.1 -scheme 'RxAlamofire tvOS' -project 'RxAlamofire.xcodeproj' -destination "platform=tvOS simulator,name=Apple TV 4K"
- name: Testing "RxAlamofire macOS" on Swift 5.1
run: |
xcodebuild test SWIFT_VERSION=5.1 -scheme 'RxAlamofire macOS' -project 'RxAlamofire.xcodeproj'
5 changes: 5 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
output: ../docs/RxAlamofire
module: RxAlamofire
xcodebuild_arguments:
- -scheme
- RxAlamofire iOS
45 changes: 45 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
--allman false
--binarygrouping none
--commas inline
--comments ignore
--decimalgrouping 3,6
--elseposition same-line
--empty void
--exponentcase lowercase
--exponentgrouping disabled
--fractiongrouping disabled
--disable blankLinesAroundMark
--header ignore
--hexgrouping 4,8
--hexliteralcase uppercase
--patternlet hoist
--ifdef indent
--indent 2
--indentcase false
--linebreaks lf
--octalgrouping none
--operatorfunc nospace
--patternlet hoist
--ranges nospace
--self remove
--semicolons inline
--stripunusedargs closure-only
--trimwhitespace always
--wraparguments after-first
--wrapcollections before-first
--enable blankLinesBetweenScopes
--enable redundantVoidReturnType
--enable strongifiedSelf
--enable trailingClosures
--enable trailingSpace
--enable typeSugar
--enable spaceInsideParens
--enable spaceInsideBrackets
--enable spaceInsideBraces
--enable spaceAroundOperators
--enable spaceAroundBraces
--enable redundantParens
--enable redundantNilInit
--enable consecutiveSpaces
--enable anyObjectProtocol
--disable isEmpty
55 changes: 55 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
disabled_rules:
- trailing_whitespace
- trailing_comma
- large_tuple
- nesting
- todo
- operator_whitespace
- colon
- identifier_name

opt_in_rules: # some rules are only opt-in
- empty_count
- yoda_condition
# Find all the available rules by running:
# swiftlint rules

included:
- Sources
- Tests

# excluded: # paths to ignore during linting. Takes precedence over `included`.

# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning # implicitly
force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 180
# they can set both implicitly with an array
function_body_length: 120
type_body_length:
- 400 # warning
- 500 # error
# or they can set both explicitly
file_length:
warning: 500
error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
generic_type_name:
min_length: 1 # only warning
max_length: 30

type_name:
min_length: 2 # only warning
max_length: # warning and error
warning: 100
error: 120
excluded: iPhone # excluded via string
identifier_name:
min_length:
warning: 1
reporter: "xcode"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tap "danger/tap"
brew "danger/tap/danger-swift"
brew "xcodegen"
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "AliSoftware/OHHTTPStubs" ~> 8.0
github "AliSoftware/OHHTTPStubs" ~> 9.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Alamofire/Alamofire" "5.2.0"
github "AliSoftware/OHHTTPStubs" "8.0.0"
github "AliSoftware/OHHTTPStubs" "9.0.0"
github "ReactiveX/RxSwift" "5.1.1"
45 changes: 45 additions & 0 deletions Dangerfile.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Danger
let danger = Danger()

let prDestination = danger.bitbucketCloud.pr.destination.branchName
let prTitle = danger.bitbucketCloud.pr.title
let prDescription = danger.bitbucketCloud.pr.description

let modifiedFiles = danger.git.modifiedFiles
let createdFiles = danger.git.createdFiles
let deletedFiles = danger.git.deletedFiles

// Sometimes it's a README fix, or something like that - which isn't relevant for
// including in a project's CHANGELOG for example
let declared_trivial = danger.bitbucketCloud.pr.title.contains("trivial")

// Make it more obvious that a PR is a work in progress and shouldn't be merged yet
if prTitle.contains("WIP") {
warn("PR is classed as Work in Progress")
}

// Warn about develop and master branch
if prDestination != "develop" || prDestination != "master" {
warn("Please target PRs to `develop` or `master` branch")
}

// Warn summary on pull request
if prDescription.count < 5 {
warn("Please provide a summary in the Pull Request description")
}

// If these are all empty something has gone wrong, better to raise it in a comment
if modifiedFiles.isEmpty, createdFiles.isEmpty, deletedFiles.isEmpty {
fail("This PR has no changes at all, this is likely a developer issue.")
}

SwiftLint.lint(inline: true, configFile: ".swiftlint.yml", strict: true)

if !danger.git.modifiedFiles.filter({ $0.contains("Cartfile") }).isEmpty {
message("Cartfile changed")
}

// Warn Cartfile changes
if !danger.git.modifiedFiles.filter({ $0.contains("Cartfile") }).isEmpty {
message("Cartfile.resolved changed")
}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'cocoapods', '~> 1.6'
gem 'cocoapods', '~> 1.9'
Loading

0 comments on commit a90c029

Please sign in to comment.