Skip to content

Commit c7b79f3

Browse files
authored
chore: add CI (#3)
1 parent 8e9f300 commit c7b79f3

File tree

7 files changed

+120
-20
lines changed

7 files changed

+120
-20
lines changed

.codecov.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
coverage:
2+
precision: 2
3+
round: down
4+
range: 70...100
5+
6+
status:
7+
project: true
8+
patch: true
9+
changes: true

.github/workflows/CI.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Drops
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
Darwin:
13+
name: Darwin
14+
runs-on: macos-latest
15+
env:
16+
PROJECT: Drops.xcodeproj
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Bundle Install
20+
run: bundle install
21+
- name: Test iOS
22+
run: |
23+
xcodebuild clean build test -project $PROJECT -scheme $SCHEME -destination "$DESTINATION" | XCPRETTY_JSON_FILE_OUTPUT="xcodebuild-ios.json" xcpretty -f `xcpretty-json-formatter`
24+
bash <(curl -s https://codecov.io/bash) -cF ios -J 'Drops'
25+
env:
26+
SCHEME: Drops
27+
DESTINATION: platform=iOS Simulator,name=iPhone 12

Drops.xcodeproj/project.pbxproj

+54-16
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,17 @@
150150
07D8146F26361DB7003F51DB /* Sources */ = {
151151
isa = PBXGroup;
152152
children = (
153+
07D8147126361DB7003F51DB /* Info.plist */,
154+
0785D37F26416E0E004D6171 /* AnimationContext.swift */,
155+
0785D38126416E3A004D6171 /* Animator.swift */,
153156
07D8148B26361DC6003F51DB /* Drop.swift */,
157+
0785D3732640BBF7004D6171 /* Drops.swift */,
154158
0755C1E1263A4EF0002209FD /* DropView.swift */,
155159
0785D37726416D6A004D6171 /* PassthroughView.swift */,
156-
0785D37B26416DB3004D6171 /* Weak.swift */,
157160
0785D37926416D84004D6171 /* PassthroughWindow.swift */,
158-
0785D37D26416DDF004D6171 /* WindowViewController.swift */,
159-
0785D37F26416E0E004D6171 /* AnimationContext.swift */,
160-
0785D38126416E3A004D6171 /* Animator.swift */,
161161
0785D38C2641F487004D6171 /* Presenter.swift */,
162-
0785D3732640BBF7004D6171 /* Drops.swift */,
163-
07D8147126361DB7003F51DB /* Info.plist */,
162+
0785D37B26416DB3004D6171 /* Weak.swift */,
163+
0785D37D26416DDF004D6171 /* WindowViewController.swift */,
164164
);
165165
path = Sources;
166166
sourceTree = "<group>";
@@ -170,23 +170,23 @@
170170
children = (
171171
07D8147D26361DB7003F51DB /* Info.plist */,
172172
0755C205263B5EFA002209FD /* DropTests.swift */,
173-
0785D3A12642429A004D6171 /* WeakTests.swift */,
174-
0785D3AA26424A0C004D6171 /* WindowViewControllerTests.swift */,
175-
0785D3A526424397004D6171 /* PassthroughViewTests.swift */,
176173
0785D3A8264244D5004D6171 /* DropViewTests.swift */,
174+
0785D3A526424397004D6171 /* PassthroughViewTests.swift */,
177175
0785D3AC26424DD2004D6171 /* PassthroughWindowTests.swift */,
176+
0785D3A12642429A004D6171 /* WeakTests.swift */,
177+
0785D3AA26424A0C004D6171 /* WindowViewControllerTests.swift */,
178178
);
179179
path = Tests;
180180
sourceTree = "<group>";
181181
};
182182
07D8149826361DE8003F51DB /* Example */ = {
183183
isa = PBXGroup;
184184
children = (
185+
07D814A726361DE9003F51DB /* Info.plist */,
185186
07D8149926361DE8003F51DB /* AppDelegate.swift */,
186187
07D8149D26361DE8003F51DB /* ViewController.swift */,
187188
07D814A226361DE9003F51DB /* Assets.xcassets */,
188189
07D814A426361DE9003F51DB /* LaunchScreen.storyboard */,
189-
07D814A726361DE9003F51DB /* Info.plist */,
190190
);
191191
path = Example;
192192
sourceTree = "<group>";
@@ -212,6 +212,7 @@
212212
07D8146926361DB7003F51DB /* Sources */,
213213
07D8146A26361DB7003F51DB /* Frameworks */,
214214
07D8146B26361DB7003F51DB /* Resources */,
215+
074941E52642ACCD0031D338 /* SwiftLint */,
215216
);
216217
buildRules = (
217218
);
@@ -229,6 +230,7 @@
229230
07D8147226361DB7003F51DB /* Sources */,
230231
07D8147326361DB7003F51DB /* Frameworks */,
231232
07D8147426361DB7003F51DB /* Resources */,
233+
074941E42642ACC30031D338 /* SwiftLint */,
232234
);
233235
buildRules = (
234236
);
@@ -247,7 +249,7 @@
247249
07D8149326361DE8003F51DB /* Sources */,
248250
07D8149426361DE8003F51DB /* Frameworks */,
249251
07D8149526361DE8003F51DB /* Resources */,
250-
0755C1E7263B518A002209FD /* Swiftlint */,
252+
0755C1E7263B518A002209FD /* SwiftLint */,
251253
0755C204263B5D0B002209FD /* Embed Frameworks */,
252254
);
253255
buildRules = (
@@ -328,7 +330,43 @@
328330
/* End PBXResourcesBuildPhase section */
329331

330332
/* Begin PBXShellScriptBuildPhase section */
331-
0755C1E7263B518A002209FD /* Swiftlint */ = {
333+
074941E42642ACC30031D338 /* SwiftLint */ = {
334+
isa = PBXShellScriptBuildPhase;
335+
buildActionMask = 2147483647;
336+
files = (
337+
);
338+
inputFileListPaths = (
339+
);
340+
inputPaths = (
341+
);
342+
name = SwiftLint;
343+
outputFileListPaths = (
344+
);
345+
outputPaths = (
346+
);
347+
runOnlyForDeploymentPostprocessing = 0;
348+
shellPath = /bin/sh;
349+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
350+
};
351+
074941E52642ACCD0031D338 /* SwiftLint */ = {
352+
isa = PBXShellScriptBuildPhase;
353+
buildActionMask = 2147483647;
354+
files = (
355+
);
356+
inputFileListPaths = (
357+
);
358+
inputPaths = (
359+
);
360+
name = SwiftLint;
361+
outputFileListPaths = (
362+
);
363+
outputPaths = (
364+
);
365+
runOnlyForDeploymentPostprocessing = 0;
366+
shellPath = /bin/sh;
367+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
368+
};
369+
0755C1E7263B518A002209FD /* SwiftLint */ = {
332370
isa = PBXShellScriptBuildPhase;
333371
buildActionMask = 2147483647;
334372
files = (
@@ -337,14 +375,14 @@
337375
);
338376
inputPaths = (
339377
);
340-
name = Swiftlint;
378+
name = SwiftLint;
341379
outputFileListPaths = (
342380
);
343381
outputPaths = (
344382
);
345383
runOnlyForDeploymentPostprocessing = 0;
346384
shellPath = /bin/sh;
347-
shellScript = "swiftlint\n";
385+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
348386
};
349387
/* End PBXShellScriptBuildPhase section */
350388

@@ -555,7 +593,7 @@
555593
"@executable_path/Frameworks",
556594
"@loader_path/Frameworks",
557595
);
558-
MARKETING_VERSION = 0.3.0;
596+
MARKETING_VERSION = 0.4.0;
559597
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
560598
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
561599
SKIP_INSTALL = YES;
@@ -584,7 +622,7 @@
584622
"@executable_path/Frameworks",
585623
"@loader_path/Frameworks",
586624
);
587-
MARKETING_VERSION = 0.3.0;
625+
MARKETING_VERSION = 0.4.0;
588626
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
589627
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
590628
SKIP_INSTALL = YES;

Gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'xcpretty'
4+
gem 'xcpretty-json-formatter'

Gemfile.lock

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
rouge (2.0.7)
5+
xcpretty (0.3.0)
6+
rouge (~> 2.0.7)
7+
xcpretty-json-formatter (0.1.1)
8+
xcpretty (~> 0.2, >= 0.0.7)
9+
10+
PLATFORMS
11+
ruby
12+
13+
DEPENDENCIES
14+
xcpretty
15+
xcpretty-json-formatter
16+
17+
BUNDLED WITH
18+
2.1.4

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import PackageDescription
2727
let package = Package(
2828
name: "Drops",
2929
platforms: [
30-
.iOS(.v13)
30+
.iOS(.v11)
3131
],
3232
products: [
3333
.library(name: "Drops", targets: ["Drops"])

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ A µFramework for showing iOS 13 like alerts.
66

77
---
88

9+
![CI](https://github.com/omaralbeik/Drops/workflows/Drops/badge.svg)
10+
[![codecov](https://codecov.io/gh/omaralbeik/Drops/branch/main/graph/badge.svg?token=399UQIKSLR)](https://codecov.io/gh/omaralbeik/Drops)
11+
[![SPM compatible](https://img.shields.io/badge/SPM-Compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)
12+
913
## Features / Todos
1014

1115
- [x] iOS 11+
@@ -14,11 +18,11 @@ A µFramework for showing iOS 13 like alerts.
1418
- [x] Show from top or buttom of screen
1519
- [x] Interactive dismissal
1620
- [x] Queue multiple drops
21+
- [x] Add basic CI with Github Actions
1722
- [ ] VoiceOver support
1823
- [ ] Accessibility checkup
1924
- [ ] SwiftUI support
20-
- [ ] Add tests
21-
- [ ] Add basic CI with Github Actions
25+
- [ ] Add more tests
2226

2327
---
2428

@@ -58,7 +62,7 @@ The [Swift Package Manager](https://swift.org/package-manager/) is a tool for ma
5862

5963
```swift
6064
dependencies: [
61-
.package(url: "https://github.com/omaralbeik/Drops.git", from: "0.2.0")
65+
.package(url: "https://github.com/omaralbeik/Drops.git", from: "0.4.0")
6266
]
6367
```
6468

0 commit comments

Comments
 (0)