Skip to content

Commit

Permalink
Merge pull request #1 from nnsnodnb/setup-ci
Browse files Browse the repository at this point in the history
Setup CI
  • Loading branch information
nnsnodnb authored Aug 9, 2021
2 parents 8f851f4 + f2a9dda commit 6e1dbbe
Show file tree
Hide file tree
Showing 16 changed files with 297 additions and 39 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Actions Lint

on: pull_request

jobs:
actionlint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: reviewdog/action-actionlint@v1
with:
reporter: github-pr-review
level: warning
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Swift build

on: push

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Build
run: swift build -Xswiftc -sdk -Xswiftc "$(xcrun --sdk iphonesimulator --show-sdk-path)" -Xswiftc -target -Xswiftc x86_64-apple-ios13.0-simulator
24 changes: 24 additions & 0 deletions .github/workflows/pod_trunk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CocoaPods Trunk

on:
push:
tags:
- "v*.*.*"

jobs:
pod_trunk:
runs-on: macos-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v2

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: bundle exec pod trunk push MultipleImageView.podspec
28 changes: 28 additions & 0 deletions .github/workflows/podspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Podspec

on:
pull_request:
paths:
- "MultipleImageView.podspec"
- "Gemfile.lock"
- ".github/workflows/podspec.yml"
push:
paths:
- "MultipleImageView.podspec"
- "Gemfile.lock"
- ".github/workflows/podspec.yml"

jobs:
podspec:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Lint
run: bundle exec pod lib lint MultipleImageView.podspec
14 changes: 14 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: SwiftLint

on: pull_request

jobs:
swiftlint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: norio-nomura/action-swiftlint@3.2.1
env:
DIFF_BASE: ${{ github.base_ref }}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,16 @@ build-iPhoneSimulator/

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

# Created by https://www.toptal.com/developers/gitignore/api/cocoapods
# Edit at https://www.toptal.com/developers/gitignore?templates=cocoapods

### CocoaPods ###
## CocoaPods GitIgnore Template

# CocoaPods - Only use to conserve bandwidth / Save time on Pushing
# - Also handy if you have a large number of dependant pods
# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE
Pods/

# End of https://www.toptal.com/developers/gitignore/api/cocoapods
46 changes: 46 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
included:
- Package.swift
- Example
- MultipleImageView
opt_in_rules:
- contains_over_first_not_nil
- closure_end_indentation
- closure_spacing
- empty_count
- explicit_init
- extension_access_modifier
- first_where
- joined_default_parameter
- literal_expression_end_indentation
- nimble_operator
- operator_usage_whitespace
- override_in_extension
- overridden_super_call
- private_action
- private_outlet
- prohibited_super_call
- quick_discouraged_call
- quick_discouraged_focused_test
- quick_discouraged_pending_test
- redundant_nil_coalescing
- single_test_class
- sorted_first_last
- sorted_imports
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- yoda_condition
disabled_rules:
- nesting
- function_parameter_count
- cyclomatic_complexity
- large_tuple
line_length: 130
type_body_length:
- 300
- 400
file_length:
warning: 500
error: 1000
function_body_length:
warning: 100
error: 200
3 changes: 2 additions & 1 deletion Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}
2 changes: 2 additions & 0 deletions Example/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ final class ViewController: UIViewController {
}
}

// swiftlint:disable line_length
private lazy var sources: [MultipleImageView.Source] = [
.uiimage(UIImage(systemName: "a.book.closed")!),
.url(URL(string: "https://1.bp.blogspot.com/-bJ0oTWgJWrk/XnoiWQBOYYI/AAAAAAABX5Y/OyhdHjIA5_0737fyRKpwEpy34x32s_G9wCNcBGAsYHQ/s450/olympics_tokyo_2021_line.png")!),
Expand All @@ -34,6 +35,7 @@ final class ViewController: UIViewController {
}
}
]
// swiftlint:enable line_length

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
83 changes: 71 additions & 12 deletions MultipleImageView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,57 @@
objects = {

/* Begin PBXBuildFile section */
021EE746118832E6631E0D24 /* Pods_MultipleImageView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D192AEFA769357CAA4AF6CCB /* Pods_MultipleImageView.framework */; };
CFDCA86B26C12B3100FC9770 /* MultipleImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = CFDCA86926C12B3100FC9770 /* MultipleImageView.h */; settings = {ATTRIBUTES = (Public, ); }; };
CFDCA87326C12B4F00FC9770 /* MultipleImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFDCA87226C12B4F00FC9770 /* MultipleImageView.swift */; };
CFDCA8A926C1394600FC9770 /* Array+Subscript.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFDCA8A826C1394600FC9770 /* Array+Subscript.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
599A5D18449E4F87AC458A99 /* Pods-MultipleImageView.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MultipleImageView.release.xcconfig"; path = "Target Support Files/Pods-MultipleImageView/Pods-MultipleImageView.release.xcconfig"; sourceTree = "<group>"; };
CFDCA86626C12B3100FC9770 /* MultipleImageView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MultipleImageView.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CFDCA86926C12B3100FC9770 /* MultipleImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MultipleImageView.h; sourceTree = "<group>"; };
CFDCA86A26C12B3100FC9770 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CFDCA87226C12B4F00FC9770 /* MultipleImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultipleImageView.swift; sourceTree = "<group>"; };
CFDCA8A826C1394600FC9770 /* Array+Subscript.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Subscript.swift"; sourceTree = "<group>"; };
D192AEFA769357CAA4AF6CCB /* Pods_MultipleImageView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MultipleImageView.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DE66E8C17C82C653F8242528 /* Pods-MultipleImageView.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MultipleImageView.debug.xcconfig"; path = "Target Support Files/Pods-MultipleImageView/Pods-MultipleImageView.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
CFDCA86326C12B3100FC9770 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
021EE746118832E6631E0D24 /* Pods_MultipleImageView.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
8DF1E8AD8731025B59A50798 /* Pods */ = {
isa = PBXGroup;
children = (
DE66E8C17C82C653F8242528 /* Pods-MultipleImageView.debug.xcconfig */,
599A5D18449E4F87AC458A99 /* Pods-MultipleImageView.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
C208D5EC0FEB90D3208CCA27 /* Frameworks */ = {
isa = PBXGroup;
children = (
D192AEFA769357CAA4AF6CCB /* Pods_MultipleImageView.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
CFDCA85C26C12B3100FC9770 = {
isa = PBXGroup;
children = (
CFDCA86826C12B3100FC9770 /* MultipleImageView */,
CFDCA86726C12B3100FC9770 /* Products */,
8DF1E8AD8731025B59A50798 /* Pods */,
C208D5EC0FEB90D3208CCA27 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -50,22 +72,13 @@
CFDCA86826C12B3100FC9770 /* MultipleImageView */ = {
isa = PBXGroup;
children = (
CFDCA8A726C1392C00FC9770 /* Internal */,
CFDCA86926C12B3100FC9770 /* MultipleImageView.h */,
CFDCA86A26C12B3100FC9770 /* Info.plist */,
CFDCA87226C12B4F00FC9770 /* MultipleImageView.swift */,
);
path = MultipleImageView;
sourceTree = "<group>";
};
CFDCA8A726C1392C00FC9770 /* Internal */ = {
isa = PBXGroup;
children = (
CFDCA8A826C1394600FC9770 /* Array+Subscript.swift */,
);
path = Internal;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand All @@ -84,10 +97,12 @@
isa = PBXNativeTarget;
buildConfigurationList = CFDCA86E26C12B3100FC9770 /* Build configuration list for PBXNativeTarget "MultipleImageView" */;
buildPhases = (
8CF7A604B8F2B175E8CF8942 /* [CP] Check Pods Manifest.lock */,
CFDCA86126C12B3100FC9770 /* Headers */,
CFDCA86226C12B3100FC9770 /* Sources */,
CFDCA86326C12B3100FC9770 /* Frameworks */,
CFDCA86426C12B3100FC9770 /* Resources */,
CFDCA8B326C14AE700FC9770 /* SwiftLint */,
);
buildRules = (
);
Expand Down Expand Up @@ -140,13 +155,55 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
8CF7A604B8F2B175E8CF8942 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MultipleImageView-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
CFDCA8B326C14AE700FC9770 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = SwiftLint;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
CFDCA86226C12B3100FC9770 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CFDCA87326C12B4F00FC9770 /* MultipleImageView.swift in Sources */,
CFDCA8A926C1394600FC9770 /* Array+Subscript.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -277,6 +334,7 @@
};
CFDCA86F26C12B3100FC9770 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DE66E8C17C82C653F8242528 /* Pods-MultipleImageView.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand Down Expand Up @@ -305,6 +363,7 @@
};
CFDCA87026C12B3100FC9770 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 599A5D18449E4F87AC458A99 /* Pods-MultipleImageView.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand Down
6 changes: 6 additions & 0 deletions MultipleImageView.xcworkspace/contents.xcworkspacedata

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

15 changes: 0 additions & 15 deletions MultipleImageView/Internal/Array+Subscript.swift

This file was deleted.

Loading

0 comments on commit 6e1dbbe

Please sign in to comment.