Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,14 @@ jobs:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: install xpretty
run: gem install xcpretty
- name: install pods
run: |
cd Example
pod install
cd ..
- uses: actions/checkout@v4
- name: environment info
run: |
swift --version
xcodebuild -version
xcodebuild -showsdks
# xcrun instruments -s devices
- name: Test
- name: Resolve package dependencies
run: |
SIMULATOR_ID=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ { print $2; exit }')
if [ -z "$SIMULATOR_ID" ]; then
echo "No available iPhone simulator found"
xcrun simctl list devices available
exit 1
fi

set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MapCache.xcworkspace -scheme MapCache-Example -destination "id=$SIMULATOR_ID" ONLY_ACTIVE_ARCH=NO | xcpretty
# TODO do not allow warnings
pod lib lint --allow-warnings
swift package resolve
- name: Test package
run: |
swift test --parallel
264 changes: 130 additions & 134 deletions Example/MapCache.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "2620"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 0 additions & 3 deletions Example/MapCache.xcworkspace/contents.xcworkspacedata

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

51 changes: 51 additions & 0 deletions Example/MapCache.xcworkspace/xcshareddata/swiftpm/Package.resolved

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

12 changes: 0 additions & 12 deletions Example/Podfile

This file was deleted.

43 changes: 0 additions & 43 deletions Example/Podfile.lock

This file was deleted.

1 change: 1 addition & 0 deletions Example/Tests/DiskCache/DiskCacheSpecs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2019 CocoaPods. All rights reserved.
//

import Foundation
import Quick
import Nimble
@testable import MapCache
Expand Down
1 change: 1 addition & 0 deletions Example/Tests/DiskCache/String+DiskCacheSpecs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2019 CocoaPods. All rights reserved.
//

import Foundation
import Quick
import Nimble
@testable import MapCache
Expand Down
14 changes: 8 additions & 6 deletions Example/Tests/MapCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,32 @@
//
// https://github.com/Quick/Quick

import Foundation
import Quick
import Nimble
import MapCache
import MapKit
import OHHTTPStubs
import OHHTTPStubsSwift

class MapCacheTests: QuickSpec {

override func spec() {
beforeSuite {
// This stub returns as data the URL of the request
stub(condition: isHost("localhost")) { request in
let stubData = request.url?.description.data(using: .utf8)
return OHHTTPStubsResponse(data: stubData!, statusCode:200, headers:nil)
let stubData = request.url?.description.data(using: String.Encoding.utf8)
return HTTPStubsResponse(data: stubData!, statusCode:200, headers:nil)
}
// This stub returns a 404 error
stub(condition: isHost("brokenhost")) { request in
let stubData = request.url?.description.data(using: .utf8)
return OHHTTPStubsResponse(data: stubData!, statusCode:404, headers:nil)
let stubData = request.url?.description.data(using: String.Encoding.utf8)
return HTTPStubsResponse(data: stubData!, statusCode:404, headers:nil)
}
}

afterSuite {
OHHTTPStubs.removeAllStubs()
HTTPStubs.removeAllStubs()
}

describe("MapCache") {
Expand All @@ -54,7 +56,7 @@ class MapCacheTests: QuickSpec {
cache.fetchTileFromServer(
at: path,
failure: {error in expect(false) == true},
success: {data in expect(String(data: data, encoding: .utf8)) == cache.url(forTilePath: path).description} )
success: {data in expect(String(data: data, encoding: String.Encoding.utf8)) == cache.url(forTilePath: path).description} )
}

it("can return error on fetch") {
Expand Down
1 change: 1 addition & 0 deletions Example/Tests/RegionDownloaderSpecs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2019 CocoaPods. All rights reserved.
//

import Foundation
import Quick
import Nimble
import MapKit
Expand Down
1 change: 1 addition & 0 deletions Example/Tests/Tests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// https://github.com/Quick/Quick

import Foundation
import Quick
import Nimble
import MapCache
Expand Down
37 changes: 0 additions & 37 deletions MapCache.podspec

This file was deleted.

50 changes: 50 additions & 0 deletions Package.resolved

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

Loading
Loading