Skip to content

Commit 19e8eb4

Browse files
committed
[UPDATE] added setup files
1 parent 0e0aeee commit 19e8eb4

File tree

8 files changed

+299
-21
lines changed

8 files changed

+299
-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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 YStepper -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' build-for-testing
31+
32+
- name: Run tests iOS
33+
run: |
34+
xcodebuild -scheme YStepper -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' test-without-building

.gitignore

Lines changed: 16 additions & 20 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
@@ -39,7 +32,7 @@ playground.xcworkspace
3932
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
4033
# Packages/
4134
# Package.pins
42-
# Package.resolved
35+
Package.resolved
4336
# *.xcodeproj
4437
#
4538
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
@@ -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: YStepper
10+
xcodebuild_arguments:
11+
- -scheme
12+
- YStepper
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/ystepper-ios/"

.swiftlint.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
- contains_over_first_not_nil
8+
- empty_count
9+
- first_where
10+
- force_unwrapping
11+
- implicit_return
12+
- missing_docs
13+
- multiline_arguments
14+
- multiline_arguments_brackets
15+
- multiline_function_chains
16+
- multiline_literal_brackets
17+
- multiline_parameters
18+
- multiline_parameters_brackets
19+
- operator_whitespace
20+
- prohibited_interface_builder
21+
- unneeded_parentheses_in_closure_argument
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+
- docs
28+
- .build
29+
30+
# configurable rules can be customized from this configuration file
31+
# binary rules can set their severity level
32+
33+
cyclomatic_complexity:
34+
ignores_case_statements: true
35+
36+
identifier_name:
37+
min_length: 1
38+
39+
trailing_whitespace:
40+
ignores_empty_lines: true
41+
42+
function_parameter_count:
43+
warning: 6

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.

README.md

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,119 @@
1-
# ystepper-ios
1+
_Accessible and customizable Stepper user interface elements for iOS._
2+
3+
Licensing
4+
----------
5+
Y—Stepper is licensed under the [Apache 2.0 license](LICENSE).
6+
7+
Documentation
8+
----------
9+
10+
Documentation is automatically generated from source code comments and rendered as a static website hosted via GitHub Pages at: https://yml-org.github.io/ystepper-ios/
11+
12+
Usage
13+
----------
14+
15+
Installation
16+
----------
17+
18+
You can add Y—Stepper to an Xcode project by adding it as a package dependency.
19+
20+
1. From the **File** menu, select **Add Packages...**
21+
2. Enter "[https://github.com/yml-org/ystepper-ios](https://github.com/yml-org/ystepper-ios)" into the package repository URL text field
22+
3. Click **Add Package**
23+
24+
Contributing to Y—Stepper
25+
----------
26+
27+
### Requirements
28+
29+
#### SwiftLint (linter)
30+
```
31+
brew install swiftlint
32+
```
33+
34+
#### Jazzy (documentation)
35+
```
36+
sudo gem install jazzy
37+
```
38+
39+
### Setup
40+
41+
Clone the repo and open `Package.swift` in Xcode.
42+
43+
### Versioning strategy
44+
45+
We utilize [semantic versioning](https://semver.org).
46+
47+
```
48+
{major}.{minor}.{patch}
49+
```
50+
51+
e.g.
52+
53+
```
54+
1.0.5
55+
```
56+
57+
### Branching strategy
58+
59+
We utilize a simplified branching strategy for our frameworks.
60+
61+
* main (and development) branch is `main`
62+
* both feature (and bugfix) branches branch off of `main`
63+
* feature (and bugfix) branches are merged back into `main` as they are completed and approved.
64+
* `main` gets tagged with an updated version # for each release
65+
66+
### Branch naming conventions:
67+
68+
```
69+
feature/{ticket-number}-{short-description}
70+
bugfix/{ticket-number}-{short-description}
71+
```
72+
e.g.
73+
```
74+
feature/CM-44-button
75+
bugfix/CM-236-textview-color
76+
```
77+
78+
### Pull Requests
79+
80+
Prior to submitting a pull request you should:
81+
82+
1. Compile and ensure there are no warnings and no errors.
83+
2. Run all unit tests and confirm that everything passes.
84+
3. Check unit test coverage and confirm that all new / modified code is fully covered.
85+
4. Run `swiftlint` from the command line and confirm that there are no violations.
86+
5. Run `jazzy` from the command line and confirm that you have 100% documentation coverage.
87+
6. Consider using `git rebase -i HEAD~{commit-count}` to squash your last {commit-count} commits together into functional chunks.
88+
7. If HEAD of the parent branch (typically `main`) has been updated since you created your branch, use `git rebase main` to rebase your branch.
89+
* _Never_ merge the parent branch into your branch.
90+
* _Always_ rebase your branch off of the parent branch.
91+
92+
When submitting a pull request:
93+
94+
* Use the [provided pull request template](PULL_REQUEST_TEMPLATE.md) and populate the Introduction, Purpose, and Scope fields at a minimum.
95+
* If you're submitting before and after screenshots, movies, or GIF's, enter them in a two-column table so that they can be viewed side-by-side.
96+
97+
When merging a pull request:
98+
99+
* Make sure the branch is rebased (not merged) off of the latest HEAD from the parent branch. This keeps our git history easy to read and understand.
100+
* Make sure the branch is deleted upon merge (should be automatic).
101+
102+
### Releasing new versions
103+
* Tag the corresponding commit with the new version (e.g. `1.0.5`)
104+
* Push the local tag to remote
105+
106+
Generating Documentation (via Jazzy)
107+
----------
108+
109+
You can generate your own local set of documentation directly from the source code using the following command from Terminal:
110+
```
111+
jazzy
112+
```
113+
This generates a set of documentation under `/docs`. The default configuration is set in the default config file `.jazzy.yaml` file.
114+
115+
To view additional documentation options type:
116+
```
117+
jazzy --help
118+
```
119+
A GitHub Action automatically runs each time a commit is pushed to `main` that runs Jazzy to generate the documentation for our GitHub page at: https://yml-org.github.io/ystepper-ios/

0 commit comments

Comments
 (0)