Skip to content

Commit ca61f5e

Browse files
author
Mark Pospesel
committed
Add code and tests for YAnalytics
1 parent e520e86 commit ca61f5e

21 files changed

+1007
-0
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 YAnalytics -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' build-for-testing
31+
32+
- name: Run tests iOS
33+
run: |
34+
xcodebuild -scheme YAnalytics -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' test-without-building
35+
36+
- name: Build tvOS
37+
run: |
38+
xcodebuild -scheme YAnalytics -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 YAnalytics -sdk appletvsimulator16.0 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation)' test-without-building

.gitignore

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Generated by MacOS
2+
.DS_Store
3+
4+
# Xcode
5+
#
6+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
7+
8+
## User settings
9+
*.xcuserstate
10+
*.xcuserdatad
11+
*.xcuserdata
12+
xcschememanagement.plist
13+
*/xcuserdata/*
14+
*.xcbkptlist
15+
*.xcworkspacedata
16+
IDEWorkspaceChecks.plist
17+
18+
## Obj-C/Swift specific
19+
*.hmap
20+
21+
## App packaging
22+
*.ipa
23+
*.dSYM.zip
24+
*.dSYM
25+
26+
## Playgrounds
27+
timeline.xctimeline
28+
playground.xcworkspace
29+
30+
# Swift Package Manager
31+
#
32+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
33+
# Packages/
34+
# Package.pins
35+
# Package.resolved
36+
# *.xcodeproj
37+
#
38+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
39+
# hence it is not needed unless you have added a package configuration file to your project
40+
# .swiftpm
41+
42+
.build/
43+
44+
# CocoaPods
45+
#
46+
# We recommend against adding the Pods directory to your .gitignore. However
47+
# you should judge for yourself, the pros and cons are mentioned at:
48+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
49+
#
50+
*/Pods/*
51+
#
52+
# Add this line if you want to avoid checking in source code from the Xcode workspace
53+
# *.xcworkspace
54+
55+
# Carthage
56+
#
57+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
58+
# Carthage/Checkouts
59+
60+
Carthage/Build/
61+
62+
# Accio dependency management
63+
Dependencies/
64+
.accio/
65+
66+
# fastlane
67+
#
68+
# It is recommended to not store the screenshots in the git repo.
69+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
70+
# For more information about the recommended setup visit:
71+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
72+
73+
fastlane/report.xml
74+
fastlane/Preview.html
75+
fastlane/screenshots/**/*.png
76+
fastlane/test_output
77+
78+
# Code Injection
79+
#
80+
# After new code Injection tools there's a generated folder /iOSInjectionProject
81+
# https://github.com/johnno1962/injectionforxcode
82+
83+
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: YAnalytics
10+
xcodebuild_arguments:
11+
- -scheme
12+
- YAnalytics
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/yanalytics-ios/"

.swiftlint.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
- implicit_return
13+
- missing_docs
14+
- multiline_arguments
15+
- multiline_arguments_brackets
16+
- multiline_function_chains
17+
- multiline_literal_brackets
18+
- multiline_parameters
19+
- multiline_parameters_brackets
20+
- operator_whitespace
21+
- prohibited_interface_builder
22+
- unneeded_parentheses_in_closure_argument
23+
- vertical_whitespace_closing_braces
24+
- vertical_whitespace_opening_braces
25+
26+
excluded: # paths to ignore during linting. Takes precedence over `included`.
27+
- Pods
28+
- docs
29+
- .build
30+
31+
# configurable rules can be customized from this configuration file
32+
# binary rules can set their severity level
33+
34+
cyclomatic_complexity:
35+
ignores_case_statements: true
36+
37+
identifier_name:
38+
min_length: 1
39+
40+
trailing_whitespace:
41+
ignores_empty_lines: true
42+
43+
function_parameter_count:
44+
warning: 6
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1420"
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 = "YAnalytics"
18+
BuildableName = "YAnalytics"
19+
BlueprintName = "YAnalytics"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "YAnalyticsTests"
32+
BuildableName = "YAnalyticsTests"
33+
BlueprintName = "YAnalyticsTests"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
</BuildActionEntries>
38+
</BuildAction>
39+
<TestAction
40+
buildConfiguration = "Debug"
41+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
42+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
shouldUseLaunchSchemeArgsEnv = "YES"
44+
codeCoverageEnabled = "YES">
45+
<Testables>
46+
<TestableReference
47+
skipped = "NO">
48+
<BuildableReference
49+
BuildableIdentifier = "primary"
50+
BlueprintIdentifier = "YAnalyticsTests"
51+
BuildableName = "YAnalyticsTests"
52+
BlueprintName = "YAnalyticsTests"
53+
ReferencedContainer = "container:">
54+
</BuildableReference>
55+
</TestableReference>
56+
</Testables>
57+
</TestAction>
58+
<LaunchAction
59+
buildConfiguration = "Debug"
60+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
61+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
62+
launchStyle = "0"
63+
useCustomWorkingDirectory = "NO"
64+
ignoresPersistentStateOnLaunch = "NO"
65+
debugDocumentVersioning = "YES"
66+
debugServiceExtension = "internal"
67+
allowLocationSimulation = "YES">
68+
</LaunchAction>
69+
<ProfileAction
70+
buildConfiguration = "Release"
71+
shouldUseLaunchSchemeArgsEnv = "YES"
72+
savedToolIdentifier = ""
73+
useCustomWorkingDirectory = "NO"
74+
debugDocumentVersioning = "YES">
75+
<MacroExpansion>
76+
<BuildableReference
77+
BuildableIdentifier = "primary"
78+
BlueprintIdentifier = "YAnalytics"
79+
BuildableName = "YAnalytics"
80+
BlueprintName = "YAnalytics"
81+
ReferencedContainer = "container:">
82+
</BuildableReference>
83+
</MacroExpansion>
84+
</ProfileAction>
85+
<AnalyzeAction
86+
buildConfiguration = "Debug">
87+
</AnalyzeAction>
88+
<ArchiveAction
89+
buildConfiguration = "Release"
90+
revealArchiveInOrganizer = "YES">
91+
</ArchiveAction>
92+
</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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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: "YAnalytics",
8+
platforms: [
9+
.iOS(.v14),
10+
.tvOS(.v14),
11+
.macOS(.v11),
12+
.watchOS(.v7)
13+
],
14+
products: [
15+
.library(
16+
name: "YAnalytics",
17+
targets: ["YAnalytics"]
18+
)
19+
],
20+
targets: [
21+
.target(
22+
name: "YAnalytics",
23+
dependencies: []
24+
),
25+
.testTarget(
26+
name: "YAnalyticsTests",
27+
dependencies: ["YAnalytics"]
28+
)
29+
]
30+
)

0 commit comments

Comments
 (0)