Skip to content

Commit f58a2c0

Browse files
author
Mark Pospesel
committed
[CM-957] Add code and tests for YNetwork
1 parent 4ef6a75 commit f58a2c0

File tree

156 files changed

+9052
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+9052
-21
lines changed

.github/workflows/run_jazzy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Run Jazzy
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push events but only for the main branch
8+
push:
9+
branches: [ main ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "deploy_docs"
17+
deploy_docs:
18+
# The type of runner that the job will run on
19+
runs-on: macos-12
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+
- uses: actions/checkout@v1
25+
- name: Publish Jazzy Docs
26+
uses: steven0351/publish-jazzy-docs@v1
27+
with:
28+
personal_access_token: ${{ secrets.ACCESS_TOKEN }}
29+
config: .jazzy.yaml
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run linter and unit tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
15+
runs-on: macos-12
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set Xcode version
21+
run: |
22+
ls -l /Applications | grep 'Xcode'
23+
sudo xcode-select -s /Applications/Xcode_14.0.1.app
24+
25+
- name: Lint code using SwiftLint
26+
run: swiftlint --strict --reporter github-actions-logging
27+
28+
- name: Build iOS
29+
run: |
30+
xcodebuild -scheme YNetwork -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' build-for-testing
31+
32+
- name: Run tests iOS
33+
run: |
34+
xcodebuild -scheme YNetwork -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' test-without-building
35+
36+
- name: Build tvOS
37+
run: |
38+
xcodebuild -scheme YNetwork -sdk appletvsimulator16.0 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation)' build-for-testing
39+
40+
- name: Run tests tvOS
41+
run: |
42+
xcodebuild -scheme YNetwork -sdk appletvsimulator16.0 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation)' test-without-building

.gitignore

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1+
# Generated by MacOS
2+
.DS_Store
3+
14
# Xcode
25
#
36
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
47

58
## User settings
6-
xcuserdata/
7-
8-
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
9-
*.xcscmblueprint
10-
*.xccheckout
11-
12-
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
13-
build/
14-
DerivedData/
15-
*.moved-aside
16-
*.pbxuser
17-
!default.pbxuser
18-
*.mode1v3
19-
!default.mode1v3
20-
*.mode2v3
21-
!default.mode2v3
22-
*.perspectivev3
23-
!default.perspectivev3
9+
*.xcuserstate
10+
*.xcuserdatad
11+
*.xcuserdata
12+
xcschememanagement.plist
13+
*/xcuserdata/*
14+
*.xcbkptlist
15+
*.xcworkspacedata
16+
IDEWorkspaceChecks.plist
2417

2518
## Obj-C/Swift specific
2619
*.hmap
@@ -54,7 +47,7 @@ playground.xcworkspace
5447
# you should judge for yourself, the pros and cons are mentioned at:
5548
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
5649
#
57-
# Pods/
50+
*/Pods/*
5851
#
5952
# Add this line if you want to avoid checking in source code from the Xcode workspace
6053
# *.xcworkspace
@@ -88,3 +81,6 @@ fastlane/test_output
8881
# https://github.com/johnno1962/injectionforxcode
8982

9083
iOSInjectionProject/
84+
85+
## Docs
86+
/docs

.jazzy.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
author: 'Y Media Labs'
2+
author_url: https://yml.co
3+
min_acl: public
4+
hide_documentation_coverage: false
5+
theme: fullwidth
6+
output: ./docs
7+
documentation: ./*.md
8+
swift_build_tool: xcodebuild
9+
module: YNetwork
10+
xcodebuild_arguments:
11+
- -scheme
12+
- YNetwork
13+
- -sdk
14+
- iphonesimulator
15+
- -destination
16+
- 'platform=iOS Simulator,name=iPhone 13'

.spi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version: 1
2+
external_links:
3+
documentation: "https://yml-org.github.io/ynetwork-ios/"

.swiftlint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# By default, SwiftLint uses a set of sensible default rules you can adjust:
2+
disabled_rules: # rule identifiers turned on by default to exclude from running
3+
4+
- multiple_closures_with_trailing_closure
5+
6+
opt_in_rules: # some rules are turned off by default, so you need to opt-in
7+
- anyobject_protocol
8+
- contains_over_first_not_nil
9+
- empty_count
10+
- first_where
11+
- force_unwrapping
12+
- multiline_arguments
13+
- multiline_arguments_brackets
14+
- multiline_function_chains
15+
- multiline_literal_brackets
16+
- multiline_parameters
17+
- multiline_parameters_brackets
18+
- operator_whitespace
19+
- prohibited_interface_builder
20+
- unneeded_parentheses_in_closure_argument
21+
- unused_import
22+
- vertical_whitespace_closing_braces
23+
- vertical_whitespace_opening_braces
24+
25+
excluded: # paths to ignore during linting. Takes precedence over `included`.
26+
- Pods
27+
28+
# configurable rules can be customized from this configuration file
29+
# binary rules can set their severity level
30+
31+
cyclomatic_complexity:
32+
ignores_case_statements: true
33+
34+
identifier_name:
35+
min_length: 1
36+
37+
trailing_whitespace:
38+
ignores_empty_lines: true
39+
40+
function_parameter_count:
41+
warning: 6
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1400"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "Hermes_HermesTests"
18+
BuildableName = "Hermes_HermesTests"
19+
BlueprintName = "Hermes_HermesTests"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "Hermes"
32+
BuildableName = "Hermes"
33+
BlueprintName = "Hermes"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "NO"
41+
buildForArchiving = "NO"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "HermesTests"
46+
BuildableName = "HermesTests"
47+
BlueprintName = "HermesTests"
48+
ReferencedContainer = "container:">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
</BuildActionEntries>
52+
</BuildAction>
53+
<TestAction
54+
buildConfiguration = "Debug"
55+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57+
shouldUseLaunchSchemeArgsEnv = "YES"
58+
codeCoverageEnabled = "YES">
59+
<Testables>
60+
<TestableReference
61+
skipped = "NO">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "HermesTests"
65+
BuildableName = "HermesTests"
66+
BlueprintName = "HermesTests"
67+
ReferencedContainer = "container:">
68+
</BuildableReference>
69+
</TestableReference>
70+
</Testables>
71+
</TestAction>
72+
<LaunchAction
73+
buildConfiguration = "Debug"
74+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
75+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
76+
launchStyle = "0"
77+
useCustomWorkingDirectory = "NO"
78+
ignoresPersistentStateOnLaunch = "NO"
79+
debugDocumentVersioning = "YES"
80+
debugServiceExtension = "internal"
81+
allowLocationSimulation = "YES">
82+
</LaunchAction>
83+
<ProfileAction
84+
buildConfiguration = "Release"
85+
shouldUseLaunchSchemeArgsEnv = "YES"
86+
savedToolIdentifier = ""
87+
useCustomWorkingDirectory = "NO"
88+
debugDocumentVersioning = "YES">
89+
<MacroExpansion>
90+
<BuildableReference
91+
BuildableIdentifier = "primary"
92+
BlueprintIdentifier = "Hermes_HermesTests"
93+
BuildableName = "Hermes_HermesTests"
94+
BlueprintName = "Hermes_HermesTests"
95+
ReferencedContainer = "container:">
96+
</BuildableReference>
97+
</MacroExpansion>
98+
</ProfileAction>
99+
<AnalyzeAction
100+
buildConfiguration = "Debug">
101+
</AnalyzeAction>
102+
<ArchiveAction
103+
buildConfiguration = "Release"
104+
revealArchiveInOrganizer = "YES">
105+
</ArchiveAction>
106+
</Scheme>

PULL_REQUEST_TEMPLATE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Introduction ##
2+
3+
In layman's terms, provide a brief introduction to the issue. No more than 3 sentences.
4+
5+
## Purpose ##
6+
7+
Explain the purpose of this pull request. Include a link to the issue being addressed.
8+
9+
## Scope ##
10+
11+
Detail the scope of the pull request, i.e. what changed.
12+
13+
// Optional sections
14+
15+
## Discussion ##
16+
17+
Any discussion about approach, challenges, etc. that you feel is relevant.
18+
19+
## Out of Scope ##
20+
21+
Call out any known issues that are purposely not addressed in this pull request.
22+
23+
## 📱 Screenshots ##
24+
25+
For UI work, please include before/after screenshots hosted in a 2-column table for easy side-by-side comparison.
26+
27+
## 🎬 Video ##
28+
29+
Same as Screenshots above.
30+
31+
## 📈 Coverage ##
32+
33+
##### Code #####
34+
35+
Include a snapshot of the Code Coverage report generated when you ran the full unit test suite.
36+
37+
##### Documentation #####
38+
39+
Include a snapshot of the documentation coverage report when you ran jazzy locally to generate documentation. We require 100% documentation coverage of all `public` interfaces.

Package.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// swift-tools-version: 5.6
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "YNetwork",
8+
platforms: [
9+
.iOS(.v13),
10+
.tvOS(.v13)
11+
],
12+
products: [
13+
.library(
14+
name: "YNetwork",
15+
targets: ["YNetwork"]
16+
)
17+
],
18+
targets: [
19+
.target(name: "YNetwork"),
20+
.testTarget(
21+
name: "YNetworkTests",
22+
dependencies: ["YNetwork"],
23+
resources: [.process("Resources")]
24+
)
25+
]
26+
)

0 commit comments

Comments
 (0)