Skip to content

Commit

Permalink
Merge pull request #60 from nimblehq/release/0.3.0
Browse files Browse the repository at this point in the history
Release 0.3.0
  • Loading branch information
Thieurom authored Dec 20, 2022
2 parents 1637142 + 7ae7e4f commit 85a36df
Show file tree
Hide file tree
Showing 90 changed files with 1,786 additions and 427 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/automatic_pull_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ on:
types: [opened, reopened, edited, synchronize]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run SwiftLint
uses: norio-nomura/[email protected]
with:
args: --strict

review_pull_request:
name: Pull request review
runs-on: macOS-12
Expand All @@ -43,6 +29,9 @@ jobs:
- name: Setup
run: make setup

- name: Lint
run: make lint

- name: Build and Test
run: bundle exec fastlane buildAndTest
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ fastlane/test_output
fastlane/FastlaneRunner

# Bundler

.bundle
vendor/bundle
82 changes: 77 additions & 5 deletions CryptoPrices.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
1C02C659294B007A00ED7DFC /* Styleguide in Frameworks */ = {isa = PBXBuildFile; productRef = 1C02C658294B007A00ED7DFC /* Styleguide */; };
1C02C65B294B008A00ED7DFC /* UseCases in Frameworks */ = {isa = PBXBuildFile; productRef = 1C02C65A294B008A00ED7DFC /* UseCases */; };
1C02C65F294B02B300ED7DFC /* Repositories in Frameworks */ = {isa = PBXBuildFile; productRef = 1C02C65E294B02B300ED7DFC /* Repositories */; };
249752BD2941901E003C6238 /* MyCoin in Frameworks */ = {isa = PBXBuildFile; productRef = 249752BC2941901E003C6238 /* MyCoin */; };
4D0A1DA029349D660038624D /* CryptoPricesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D0A1D9F29349D660038624D /* CryptoPricesApp.swift */; };
4D0A1DA229349D660038624D /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D0A1DA129349D660038624D /* ContentView.swift */; };
Expand All @@ -15,6 +18,12 @@
4D0A1DB129349D670038624D /* CryptoPricesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D0A1DB029349D670038624D /* CryptoPricesTests.swift */; };
4D0A1DBB29349D670038624D /* CryptoPricesUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D0A1DBA29349D670038624D /* CryptoPricesUITests.swift */; };
4D0A1DBD29349D670038624D /* CryptoPricesUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D0A1DBC29349D670038624D /* CryptoPricesUITestsLaunchTests.swift */; };
4DBA27B0294AD1C700D15E33 /* UseCases in Frameworks */ = {isa = PBXBuildFile; productRef = 4DBA27AF294AD1C700D15E33 /* UseCases */; };
4DBA27B2294AD1F000D15E33 /* Repositories in Frameworks */ = {isa = PBXBuildFile; productRef = 4DBA27B1294AD1F000D15E33 /* Repositories */; };
4DBA27B4294AD21300D15E33 /* NetworkExtension in Frameworks */ = {isa = PBXBuildFile; productRef = 4DBA27B3294AD21300D15E33 /* NetworkExtension */; };
4DBA27B7294AD26300D15E33 /* Pilot in Frameworks */ = {isa = PBXBuildFile; productRef = 4DBA27B6294AD26300D15E33 /* Pilot */; };
4DBA27B9294AD26300D15E33 /* PilotTestSupport in Frameworks */ = {isa = PBXBuildFile; productRef = 4DBA27B8294AD26300D15E33 /* PilotTestSupport */; };
4DBA27BB294AD26300D15E33 /* PilotType in Frameworks */ = {isa = PBXBuildFile; productRef = 4DBA27BA294AD26300D15E33 /* PilotType */; };
4DF0741C293C8D3900E1274D /* Home in Frameworks */ = {isa = PBXBuildFile; productRef = 4DF0741B293C8D3900E1274D /* Home */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -59,8 +68,14 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4DBA27B2294AD1F000D15E33 /* Repositories in Frameworks */,
4DBA27B0294AD1C700D15E33 /* UseCases in Frameworks */,
4DF0741C293C8D3900E1274D /* Home in Frameworks */,
4DBA27BB294AD26300D15E33 /* PilotType in Frameworks */,
4DBA27B7294AD26300D15E33 /* Pilot in Frameworks */,
4DBA27B4294AD21300D15E33 /* NetworkExtension in Frameworks */,
249752BD2941901E003C6238 /* MyCoin in Frameworks */,
4DBA27B9294AD26300D15E33 /* PilotTestSupport in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -219,6 +234,12 @@
packageProductDependencies = (
4DF0741B293C8D3900E1274D /* Home */,
249752BC2941901E003C6238 /* MyCoin */,
4DBA27AF294AD1C700D15E33 /* UseCases */,
4DBA27B1294AD1F000D15E33 /* Repositories */,
4DBA27B3294AD21300D15E33 /* NetworkExtension */,
4DBA27B6294AD26300D15E33 /* Pilot */,
4DBA27B8294AD26300D15E33 /* PilotTestSupport */,
4DBA27BA294AD26300D15E33 /* PilotType */,
);
productName = CryptoPrices;
productReference = 4D0A1D9C29349D660038624D /* CryptoPrices.app */;
Expand Down Expand Up @@ -293,6 +314,7 @@
);
mainGroup = 4D0A1D9329349D660038624D;
packageReferences = (
4DBA27B5294AD26300D15E33 /* XCRemoteSwiftPackageReference "Pilot" */,
);
productRefGroup = 4D0A1D9D29349D660038624D /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -349,7 +371,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif [ -z \"$CI\" ]; then\n if which swiftlint > /dev/null; then\n swiftlint\n else\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\n fi\nfi\n";
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif [ -z \"$CI\" ]; then\n if which swiftlint > /dev/null; then\n make lint\n else\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\n fi\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -478,7 +500,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.0;
MARKETING_VERSION = 0.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.nimblehq.crypto-prices.staging";
PRODUCT_MODULE_NAME = CryptoPrices;
PRODUCT_NAME = "$(TARGET_NAME) Staging";
Expand Down Expand Up @@ -609,7 +631,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.0;
MARKETING_VERSION = 0.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.nimblehq.crypto-prices.staging";
PRODUCT_MODULE_NAME = CryptoPrices;
PRODUCT_NAME = "$(TARGET_NAME) Staging";
Expand Down Expand Up @@ -798,7 +820,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.0;
MARKETING_VERSION = 0.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.nimblehq.crypto-prices";
PRODUCT_MODULE_NAME = CryptoPrices;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -835,7 +857,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.2.0;
MARKETING_VERSION = 0.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.nimblehq.crypto-prices";
PRODUCT_MODULE_NAME = CryptoPrices;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -975,11 +997,61 @@
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
4DBA27B5294AD26300D15E33 /* XCRemoteSwiftPackageReference "Pilot" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Thieurom/Pilot";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.5.1;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
1C02C658294B007A00ED7DFC /* Styleguide */ = {
isa = XCSwiftPackageProductDependency;
productName = Styleguide;
};
1C02C65A294B008A00ED7DFC /* UseCases */ = {
isa = XCSwiftPackageProductDependency;
productName = UseCases;
};
1C02C65E294B02B300ED7DFC /* Repositories */ = {
isa = XCSwiftPackageProductDependency;
productName = Repositories;
};
249752BC2941901E003C6238 /* MyCoin */ = {
isa = XCSwiftPackageProductDependency;
productName = MyCoin;
};
4DBA27AF294AD1C700D15E33 /* UseCases */ = {
isa = XCSwiftPackageProductDependency;
productName = UseCases;
};
4DBA27B1294AD1F000D15E33 /* Repositories */ = {
isa = XCSwiftPackageProductDependency;
productName = Repositories;
};
4DBA27B3294AD21300D15E33 /* NetworkExtension */ = {
isa = XCSwiftPackageProductDependency;
productName = NetworkExtension;
};
4DBA27B6294AD26300D15E33 /* Pilot */ = {
isa = XCSwiftPackageProductDependency;
package = 4DBA27B5294AD26300D15E33 /* XCRemoteSwiftPackageReference "Pilot" */;
productName = Pilot;
};
4DBA27B8294AD26300D15E33 /* PilotTestSupport */ = {
isa = XCSwiftPackageProductDependency;
package = 4DBA27B5294AD26300D15E33 /* XCRemoteSwiftPackageReference "Pilot" */;
productName = PilotTestSupport;
};
4DBA27BA294AD26300D15E33 /* PilotType */ = {
isa = XCSwiftPackageProductDependency;
package = 4DBA27B5294AD26300D15E33 /* XCRemoteSwiftPackageReference "Pilot" */;
productName = PilotType;
};
4DF0741B293C8D3900E1274D /* Home */ = {
isa = XCSwiftPackageProductDependency;
productName = Home;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@
ReferencedContainer = "container:CryptoPrices.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "NO"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D0A1DB529349D670038624D"
BuildableName = "CryptoPricesUITests.xctest"
BlueprintName = "CryptoPricesUITests"
ReferencedContainer = "container:CryptoPrices.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand All @@ -29,7 +43,8 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D0A1DAB29349D670038624D"
Expand All @@ -38,14 +53,58 @@
ReferencedContainer = "container:CryptoPrices.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "UseCasesTests"
BuildableName = "UseCasesTests"
BlueprintName = "UseCasesTests"
ReferencedContainer = "container:CryptoPrices/Sources/Domain">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "HomeTests"
BuildableName = "HomeTests"
BlueprintName = "HomeTests"
ReferencedContainer = "container:CryptoPrices/Sources/Home">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MyCoinTests"
BuildableName = "MyCoinTests"
BlueprintName = "MyCoinTests"
ReferencedContainer = "container:CryptoPrices/Sources/MyCoin">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "StyleguideTests"
BuildableName = "StyleguideTests"
BlueprintName = "StyleguideTests"
ReferencedContainer = "container:CryptoPrices/Sources/Styleguide">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D0A1DB529349D670038624D"
BuildableName = "CryptoPricesUITests.xctest"
BlueprintName = "CryptoPricesUITests"
ReferencedContainer = "container:CryptoPrices.xcodeproj">
BlueprintIdentifier = "RepositoriesTests"
BuildableName = "RepositoriesTests"
BlueprintName = "RepositoriesTests"
ReferencedContainer = "container:CryptoPrices/Sources/Data">
</BuildableReference>
</TestableReference>
</Testables>
Expand Down
19 changes: 17 additions & 2 deletions CryptoPrices/Sources/App/CryptoPricesApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,33 @@
//

import Home
import NetworkExtension
import Pilot
import Repositories
import Styleguide
import SwiftUI
import UseCases

@main
struct CryptoPricesApp: App {

// TODO: Apply DI instead of manually initializing
private let network = Pilot<CoinRoute>()

var body: some Scene {
// TODO: Apply DI instead of manually initializing
WindowGroup {
HomeView()
HomeView(
viewModel: HomeViewModel(
myCoinsUseCase: MyCoinsUseCase(
repository: CoinRepository(coinAPI: network)
)
)
)
}
}

init() {
Font.Inter.registerFonts()
Fonts.registerAllCustomFonts()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import NetworkCore
public class MockCoinAPI: CoinAPIProtocol {

public var myCoinsReturnValue: Result<[APICoin], Error>?
public var trendingCoinsReturnValue: Result<[APICoin], Error>?

public init(myCoinsReturnValue: Result<[APICoin], Error>? = nil) {
self.myCoinsReturnValue = myCoinsReturnValue
}
public init() {}

public func myCoins() async throws -> [APICoin] {
guard let myCoinsReturnValue = myCoinsReturnValue else {
Expand All @@ -28,8 +27,15 @@ public class MockCoinAPI: CoinAPIProtocol {
}
}

public func trendingCoins() async throws -> [APICoin] {
fatalError("not implemented")
public func trendingCoins(coinIDs: [String]) async throws -> [APICoin] {
guard let trendingCoinsReturnValue = trendingCoinsReturnValue else {
fatalError("trendingCoinsReturnValue was not set!")
}

switch trendingCoinsReturnValue {
case let .success(trendingCoins): return trendingCoins
case let .failure(error): throw error
}
}

public func coinDetail() async throws -> APICoin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
public struct APICoin: Decodable, Equatable {

public let id: String
public let symbol: String
public let name: String
public let image: URL
public let currentPrice: Decimal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public protocol CoinAPIProtocol {

// TODO: Update when implement
func myCoins() async throws -> [APICoin]
func trendingCoins() async throws -> [APICoin]
func trendingCoins(coinIDs: [String]) async throws -> [APICoin]
func coinDetail() async throws -> APICoin
}
Loading

0 comments on commit 85a36df

Please sign in to comment.