Skip to content

Commit

Permalink
IOS-3302: Initial Project Setup (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaptonstall authored Oct 7, 2021
1 parent fbd4f39 commit 3fe8a54
Show file tree
Hide file tree
Showing 36 changed files with 2,200 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file is sourced from https://github.com/spothero/Shared-iOS

# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# Source: https://blog.github.com/2017-07-06-introducing-code-owners/
# Source: https://help.github.com/articles/about-codeowners/

# These owners will be the default owners for everything in the repo.
* @spothero/ios
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
PACKAGE_NAME: CoreDataHero
XCODEBUILD_WORKSPACE: CoreDataHero.xcworkspace
XCODEBUILD_SCHEME: CoreDataHero
DEPLOY_DIRECTORY: deploy

jobs:
lint:
name: Lint
runs-on: macos-11
permissions:
pull-requests: write
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Dependencies
run: |
bundle install
brew install swiftformat
- name: Run Danger
run: sh ./scripts/danger_lint.sh
iOS:
name: iOS ${{ matrix.os }} ${{ matrix.device_name }}
runs-on: macos-11
needs: [lint]
strategy:
matrix:
device_name: ["iPhone 12 Pro", "iPad Pro (11-inch) (2nd generation)"]
os: ["15.0"]
xcode_version: ["13.0"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Switch Xcode Version
run: sudo xcode-select -switch "/Applications/Xcode_${{ matrix.xcode_version }}.app"
- name: Run Tests
run: sh ./scripts/xcode_build.sh "name=${{ matrix.device_name }},OS=${{ matrix.os }},platform=iOS Simulator"
- name: Upload Step Output
uses: actions/upload-artifact@v1
with:
name: "iOS ${{ matrix.os }} ${{ matrix.device_name }} Output"
path: ${{ env.DEPLOY_DIRECTORY }}
macOS:
name: macOS
runs-on: macos-11
needs: [lint]
strategy:
matrix:
xcode_version: ["13.0"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Switch Xcode Version
run: sudo xcode-select -switch "/Applications/Xcode_${{ matrix.xcode_version }}.app"
- name: Run Tests
run: sh ./scripts/xcode_build.sh "platform=macOS"
- name: Upload Step Output
uses: actions/upload-artifact@v1
with:
name: "macOS 10.15 Output"
path: ${{ env.DEPLOY_DIRECTORY }}
tvOS:
name: tvOS ${{ matrix.os }} ${{ matrix.device_name }}
runs-on: macos-11
needs: [lint]
strategy:
matrix:
device_name: ["Apple TV 4K"]
os: ["15.0"]
xcode_version: ["13.0"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Switch Xcode Version
run: sudo xcode-select -switch "/Applications/Xcode_${{ matrix.xcode_version }}.app"
- name: Run Tests
run: sh ./scripts/xcode_build.sh "name=${{ matrix.device_name }},OS=${{ matrix.os }},platform=tvOS Simulator"
- name: Upload Step Output
uses: actions/upload-artifact@v1
with:
name: "tvOS ${{ matrix.os }} ${{ matrix.device_name }} Output"
path: ${{ env.DEPLOY_DIRECTORY }}
spm:
name: SPM (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: [lint]
strategy:
matrix:
os: [macos-11]
xcode_version: ["13.0"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Switch Xcode Version
run: sudo xcode-select -switch "/Applications/Xcode_${{ matrix.xcode_version }}.app"
- name: Run Tests
run: sh ./scripts/swift_build.sh
- name: Upload Step Output
uses: actions/upload-artifact@v1
with:
name: SPM Output
path: ${{ env.DEPLOY_DIRECTORY }}
89 changes: 89 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Exclude OS X folder attributes
.DS_Store

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/

# .swiftpm/ is generated when editing a Swift package in Xcode 11
.swiftpm/

# For SPM-only projects, .xcworkspace or .xcodeproj files should never be created or generated, except for use with versions earlier than Xcode 11
# *.xcworkspace
# *.xcodeproj

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build

# jazzy
undocumented.json
*.tgz

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/test_output
fastlane/[Pp]rovisioning
fastlane/report.xml
fastlane/[Bb]uild
fastlane/[Oo]utput
fastlane/DerivedData
fastlane/derived_data
fastlane/screenshots
fastlane/[Pp]review.html

# dotenv
# A .env.local file contains keys that should never be checked into the repository
.env.local
42 changes: 42 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Updated for v0.70.0

AllCops:
Exclude:
- 'Pods/**/*'
Include:
- '**/Dangerfile'
- '**/Fastfile'
- '**/Gemfile'
- '**/Podfile'
- '**/*.rb'
- '**/*.podspec'

# Matches SwiftLint line length
Layout/LineLength:
Max: 150

# ABC size = Assignment Branch Condition size, kind of like cyclomatic complexity
# Fastlane as a whole kind of blows up when this is enabled, so we're turning it off (at least for now)
Metrics/AbcSize:
Enabled: false

# We don't care about block length right now
Metrics/BlockLength:
Enabled: false

# We don't care about method length right now
Metrics/MethodLength:
Enabled: false

# This means we prefer the use of !!foo instead of !foo.nil?
Style/DoubleNegation:
Enabled: false

# Matches SwiftLint rules on trailing commas in multiline
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

# Opt out of using %w or %W for arrays of words.
# Example: ['Foo', 'Bar'] instead of %w[Foo Bar]
Style/WordArray:
Enabled: false
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.2
70 changes: 70 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Updated for v0.40.11

#---------------------#
# SwiftFormat Options #
#---------------------#

--swiftversion 5.2

#-------------------#
# Whitelisted Rules #
#-------------------#

# Use this section to opt-in to rules explicitly
# When rules in this list are enabled, no other rules will be run

# --rules redundantSelf
# --rules trailingSpace

#--------------------#
# Rule Configuration #
#--------------------#

# makes sure the self. prefix is added where appropriate
--self insert

# only strips unused arguments (replacing with _) in closures, not methods
--stripunusedargs closure-only

# sets the header block to supplied text
--header "Copyright © {year} SpotHero, Inc. All rights reserved."

# only trims whitespace on nonblank-lines to avoid xcode inconsistencies
--trimwhitespace nonblank-lines

# this removes the underscore (_) separation in large numbers
--binarygrouping none
--decimalgrouping none
--hexgrouping none
--octalgrouping none
--exponentgrouping disabled
--fractiongrouping disabled

#----------------#
# Disabled Rules #
#----------------#

# Enforces consistent ordering for member specifiers
# Disabled because this rule is non-configurable
--disable specifiers

# Removes return within closures as well as the new Swift 5 implicit return
# Disabled because this rule is non-configurable
--disable redundantReturn

# Wrap the opening brace of multiline statements
# Disabled because this rule is non-configurable
--disable wrapMultilineStatementBraces

#-----------------#
# File Exclusions #
#-----------------#

--exclude Pods
--exclude .build
--exclude .swiftpm
--exclude Package.swift
--exclude */Package.swift
--exclude Tests/LinuxMain.swift
--exclude "Tests/*/XCTestManifests.swift"
--exclude "**/*/*+CoreDataProperties.swift"
Loading

0 comments on commit 3fe8a54

Please sign in to comment.