Skip to content

Commit

Permalink
shendy/swift6 upgrade dependencies (#7)
Browse files Browse the repository at this point in the history
* upgrade AppState to 2.0.0

* fix: Call to main actor-isolated initializer

* Update macOS.yml

* Fix test

---------

Co-authored-by: Zach <[email protected]>
  • Loading branch information
devahmedshendy and 0xLeif authored Oct 2, 2024
1 parent ad8917c commit 66ca52c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: macOS

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

jobs:
build:
runs-on: macos-13

runs-on: macos-latest
steps:
- uses: swift-actions/setup-swift@v1
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v3
- name: Build for release
run: swift build -v -c release
- name: Test
run: swift test -v
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.0
- uses: actions/checkout@v3
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/0xLeif/AppState.git", from: "1.0.0")
.package(url: "https://github.com/0xLeif/AppState.git", from: "2.0.0")
],
targets: [
.target(
Expand Down
1 change: 1 addition & 0 deletions Sources/FeedbackKit/FeedbackStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Cache
import Foundation

extension Application {
@MainActor
fileprivate var storedFeedback: FileState<[UUID: Feedback]> {
fileState(initial: [:], filename: "storedFeedback")
}
Expand Down
1 change: 1 addition & 0 deletions Sources/FeedbackKit/FeedbackViewModel.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Combine
import SwiftUI

@MainActor
class FeedbackViewModel: ObservableObject {
private var bag: Set<AnyCancellable>

Expand Down
12 changes: 11 additions & 1 deletion Tests/FeedbackKitTests/FeedbackKitTests.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import XCTest
@testable import FeedbackKit

@MainActor
final class FeedbackKitTests: XCTestCase {
func testExample() throws {
let store = FeedbackStore()


let feedback = Feedback(type: .comment, title: "Cool", description: "Feedback", state: .open)

store.set(feedback: feedback)

let storedFeedback = try XCTUnwrap(store.get(id: feedback.id))

XCTAssertEqual(storedFeedback.type, storedFeedback.type)
XCTAssertEqual(storedFeedback.title, storedFeedback.title)
XCTAssertEqual(storedFeedback.description, storedFeedback.description)
XCTAssertEqual(storedFeedback.state, storedFeedback.state)
}
}

0 comments on commit 66ca52c

Please sign in to comment.