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
6 changes: 5 additions & 1 deletion .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
API-Check:
name: Diagnose API Breaking Changes
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark Workspace As Safe
Expand Down
194 changes: 194 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
name: Swift Version Compatibility

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
Build-Release-6-1:
name: Build Swift 6.1 Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.1"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration release

Build-Debug-6-1:
name: Build Swift 6.1 Debug
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.1"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration debug

Build-Release-6-2:
name: Build Swift 6.2 Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.2"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration release

Build-Debug-6-2:
name: Build Swift 6.2 Debug
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.2"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration debug

Build-Release-6-3:
name: Build Swift 6.3 Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.3"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration release

Build-Debug-6-3:
name: Build Swift 6.3 Debug
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.3"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration debug

Build-Release-6-4:
name: Build Swift 6.4 Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.4.x-snapshot"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration release

Build-Debug-6-4:
name: Build Swift 6.4 Debug
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "6.4.x-snapshot"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration debug

Build-Release-main:
name: Build Swift main Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "main-snapshot"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration release

Build-Debug-main:
name: Build Swift main Debug
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Set Swift Version
uses: vapor/swiftly-action@v0.2
with:
toolchain: "main-snapshot"
- name: Swift Version
run: |
swift --version
- name: Build
run: |
swift build --configuration debug
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
Test-Release:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Swift Version
run: |
swift --version
Expand All @@ -27,7 +34,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Swift Version
run: |
swift --version
Expand Down
22 changes: 13 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

//
Expand All @@ -13,6 +13,14 @@

import PackageDescription

let swiftSettings: [PackageDescription.SwiftSetting] = [
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("InternalImportsByDefault"),
.enableUpcomingFeature("MemberImportVisibility"),
.enableUpcomingFeature("InferIsolatedConformances"),
.enableUpcomingFeature("ImmutableWeakCaptures"),
]

let package = Package(
name: "CodableDatastore",
platforms: [
Expand All @@ -28,8 +36,8 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/mochidev/AsyncSequenceReader.git", .upToNextMinor(from: "0.3.1")),
.package(url: "https://github.com/mochidev/Bytes.git", .upToNextMinor(from: "0.3.0")),
.package(url: "https://github.com/mochidev/AsyncSequenceReader.git", .upToNextMinor(from: "0.5.0")),
.package(url: "https://github.com/mochidev/Bytes.git", .upToNextMinor(from: "0.6.2")),
],
targets: [
.target(
Expand All @@ -38,16 +46,12 @@ let package = Package(
"AsyncSequenceReader",
"Bytes"
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
]
swiftSettings: swiftSettings
),
.testTarget(
name: "CodableDatastoreTests",
dependencies: ["CodableDatastore"],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
]
swiftSettings: swiftSettings
),
]
)
47 changes: 0 additions & 47 deletions Package@swift-6.0.swift

This file was deleted.

10 changes: 3 additions & 7 deletions Sources/CodableDatastore/Datastore/Datastore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
// mochidev-codable-datastore: 8A3D87799CB24B2BA7A7661369B88325
//

#if canImport(Darwin)
import Foundation
#else
@preconcurrency import Foundation
#endif
public import Foundation

/// A store for a homogenous collection of instances.
public actor Datastore<Format: DatastoreFormat, AccessMode: _AccessMode>: Sendable {
Expand Down Expand Up @@ -177,7 +173,7 @@ extension Datastore {
}
}

func registerAndMigrate(with transaction: DatastoreInterfaceProtocol) async throws -> Progress {
func registerAndMigrate(with transaction: any DatastoreInterfaceProtocol) async throws -> Progress {
let persistedDescriptor = try await transaction.register(datastore: self)

/// Only operate on read-write datastores beyond this point.
Expand Down Expand Up @@ -1680,6 +1676,6 @@ extension Datastore where InstanceType: Identifiable, IdentifierType == Instance

private enum TaskStatus<Value> {
case waiting
case inProgress(Task<Value, Error>)
case inProgress(Task<Value, any Error>)
case complete(Value)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// mochidev-codable-datastore: 8A3D87799CB24B2BA7A7661369B88325
//

import Foundation
public import Foundation

/// A description of a ``Datastore``'s requirements of a persistence.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/CodableDatastore/Datastore/DatastoreError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// mochidev-codable-datastore: 8A3D87799CB24B2BA7A7661369B88325
//

import Foundation
public import Foundation

/// A ``Datastore``-specific error.
public enum DatastoreError: LocalizedError {
Expand Down
Loading
Loading