Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Install missing dependencies #23

Merged
merged 8 commits into from
Jun 2, 2024
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
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: iOS Unit Tests
name: Unit Tests

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
unit_test:
Expand All @@ -16,6 +20,21 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Install dependencies
run: |
make install-typeshare && make install-toolchains
brew install swiftgen xcbeautify

- name: Build Core
run: make generate
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ DerivedData/
.DS_Store
*~
Packages/Gemstone/
.vscode/settings.json
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ core-upgrade:
git submodule update --recursive --remote

test:
cd xcodebuild -scheme Gem -destination 'platform=iOS Simulator,name=iPhone 14' test | xcbeautify
@set -o pipefail && xcodebuild -project Gem.xcodeproj \
-scheme Gem \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 15" \
test | xcbeautify

localize:
@sh core/scripts/localize.sh ios Assets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ extension LocalKeystore {
let id = NSUUID().uuidString
return LocalKeystore(
folder: id,
walletStore: WalletStore(db: DB(path: "\(id)..sqlite")),
walletStore: WalletStore(db: DB(path: "\(id).sqlite")),
preferences: preferences,
keystorePassword: keystorePassword
)
Expand Down
10 changes: 10 additions & 0 deletions Packages/Primitives/Sources/AssetDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ public struct AssetFull: Codable {
}
}

public struct AssetMarketPrice: Codable {
public let price: Price?
public let market: AssetMarket?

public init(price: Price?, market: AssetMarket?) {
self.price = price
self.market = market
}
}

public struct AssetDetailsInfo: Codable {
public let details: AssetDetails
public let market: AssetMarket
Expand Down
16 changes: 8 additions & 8 deletions Packages/Store/Sources/DB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ import GRDB
public class DB: ObservableObject {
private let documentsDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
public let dbQueue: DatabaseQueue

static let ignoreMethods = ["COMMIT TRANSACTION", "PRAGMA query_only", "BEGIN DEFERRED TRANSACTION"].asSet()

public static var defaultConfiguration: GRDB.Configuration = {
var config = GRDB.Configuration()
#if DEBUG
#if DEBUG
config.publicStatementArguments = true
config.prepareDatabase { db in
db.trace { //sql in
switch $0 {
case .profile(let statement, let duration):
break
break
//NSLog("profile SQL> \(statement)")
case .statement(let statement):
let sql = statement.sql

if ignoreMethods.filter({ sql.description.contains($0) }).isEmpty {
//NSLog("SQL> \(sql)")
}
}
}
}
#endif
#endif
return config
}()
let dbPath: URL
Expand All @@ -36,9 +36,9 @@ public class DB: ObservableObject {
path: String,
configuration: GRDB.Configuration = DB.defaultConfiguration
) {
dbPath = URL(fileURLWithPath: String(format: "%@/%@", documentsDirectory, path))
dbPath = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true).appending(path: path)
dbQueue = try! DatabaseQueue(path: dbPath.absoluteString, configuration: configuration)

try! migrations.run(dbQueue: dbQueue)
}

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 💎 Gem Wallet - iOS

[![iOS Unit Tests](https://github.com/gemwalletcom/gem-ios/actions/workflows/ci.yml/badge.svg)](https://github.com/gemwalletcom/gem-ios/actions/workflows/ci.yml)

<b>Gem Wallet</b> is a powerful and secure mobile application designed for iOS and [Android](https://github.com/gemwalletcom/gem-android). It provides users with a seamless and intuitive experience to manage their digital assets and cryptocurrencies.

The app is developed using SwiftUI. The codebase also includes a [Core](https://github.com/gemwalletcom/core) library implemented in Rust, providing efficient and secure cryptographic operations for enhanced data protection.
Expand Down Expand Up @@ -32,7 +34,6 @@ The app is developed using SwiftUI. The codebase also includes a [Core](https://
- 🔔 **Customizable Notifications:** Set alerts for transactions, price changes, and important events.
- 🛡️ **Advanced Security:** Encryption and secure key management.


<img src="https://assets.gemwallet.com/screenshots/wallet.png" alt="" width="250" height="540" /> <img src="https://assets.gemwallet.com/screenshots/buy.png" alt="" width="250" height="540" /> <img src="https://assets.gemwallet.com/screenshots/collectibles.png" alt="" width="250" height="540" />

## 🏄‍♂️ Contributing
Expand Down Expand Up @@ -60,6 +61,7 @@ If you want to contribute, you can use our [developers telegram](https://t.me/ge
## 🚀 Getting Started

### iOS Development

1. Setup [Xcode](https://developer.apple.com/xcode)
2. Run `make boostrap-ios` to install all nessesary tools.

Expand All @@ -69,7 +71,7 @@ We love contributors! Feel free to contribute to this project but please read th

## 🌍 Localization

Join us in making our app accessible worldwide! Contribute to localization efforts by visiting our [Lokalise project](https://app.lokalise.com/public/94865410644ee707546334.60736699)
Join us in making our app accessible worldwide! Contribute to localization efforts by visiting our [Lokalise project](https://app.lokalise.com/public/94865410644ee707546334.60736699)

## ⚖️ License

Expand Down
Loading