Skip to content

Commit

Permalink
Make Sendable and Add Swift 6.0 Build (#25)
Browse files Browse the repository at this point in the history
* Bump github.com/apple/swift-openapi-generator from 1.2.1 to 1.4.0

Bumps [github.com/apple/swift-openapi-generator](https://github.com/apple/swift-openapi-generator) from 1.2.1 to 1.4.0.
- [Release notes](https://github.com/apple/swift-openapi-generator/releases)
- [Commits](apple/swift-openapi-generator@1.2.1...1.4.0)

---
updated-dependencies:
- dependency-name: github.com/apple/swift-openapi-generator
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump github.com/apple/swift-openapi-urlsession from 1.0.0 to 1.0.2

Bumps [github.com/apple/swift-openapi-urlsession](https://github.com/apple/swift-openapi-urlsession) from 1.0.0 to 1.0.2.
- [Release notes](https://github.com/apple/swift-openapi-urlsession/releases)
- [Commits](apple/swift-openapi-urlsession@1.0.0...1.0.2)

---
updated-dependencies:
- dependency-name: github.com/apple/swift-openapi-urlsession
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump github.com/apple/swift-openapi-runtime from 1.3.2 to 1.6.0

Bumps [github.com/apple/swift-openapi-runtime](https://github.com/apple/swift-openapi-runtime) from 1.3.2 to 1.6.0.
- [Release notes](https://github.com/apple/swift-openapi-runtime/releases)
- [Commits](apple/swift-openapi-runtime@1.3.2...1.6.0)

---
updated-dependencies:
- dependency-name: github.com/apple/swift-openapi-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump github.com/apple/swift-openapi-runtime from 1.3.2 to 1.4.0

Bumps [github.com/apple/swift-openapi-runtime](https://github.com/apple/swift-openapi-runtime) from 1.3.2 to 1.4.0.
- [Release notes](https://github.com/apple/swift-openapi-runtime/releases)
- [Commits](apple/swift-openapi-runtime@1.3.2...1.4.0)

---
updated-dependencies:
- dependency-name: github.com/apple/swift-openapi-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* adding dev container

* adding ci update (#18)

* Setting up Package for Swift 6

* setting up swift 6

* fixing swift 5.9

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] authored and leogdion committed Nov 5, 2024
1 parent 2fa4b95 commit f49b4c9
Show file tree
Hide file tree
Showing 17 changed files with 267 additions and 55 deletions.
39 changes: 39 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Swift",
"image": "swift:6.0",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
39 changes: 39 additions & 0 deletions .devcontainer/swift-5.9/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Swift",
"image": "swift:5.9",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root"
}
39 changes: 39 additions & 0 deletions .devcontainer/swift-6.0/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "Swift",
"image": "swift:6.0",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
28 changes: 19 additions & 9 deletions .github/workflows/IPSWDownloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
runs-on: [ubuntu-20.04, ubuntu-22.04]
swift-version: [5.9, "5.10"]
swift-version: [5.9, "5.10", "6.0"]
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Prepare Code Coverage
run: llvm-cov export -format="lcov" .build/x86_64-unknown-linux-gnu/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: spm,${{ env.RELEASE_NAME }},${{ env.SWIFT_VER }}
Expand Down Expand Up @@ -89,6 +89,12 @@ jobs:
watchOSVersion: "10.2"
watchName: "Apple Watch Ultra 2 (49mm)"
iPhoneName: "iPhone 15 Pro Max"
- runs-on: macos-15
xcode: "/Applications/Xcode_16.1.app"
iOSVersion: "18.1"
watchOSVersion: "11.1"
watchName: "Apple Watch Ultra 2 (49mm)"
iPhoneName: "iPhone 16"
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
Expand All @@ -104,7 +110,7 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache mint
if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }}
if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_16.1.app' }}
id: cache-mint
uses: actions/cache@v4
env:
Expand All @@ -121,7 +127,7 @@ jobs:
- name: Setup Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
- name: Install mint
if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }}
if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_16.1.app' }}
run: |
brew update
brew install mint
Expand All @@ -130,6 +136,8 @@ jobs:
- name: Run Swift Package tests
run: swift test -v --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
with:
fail-on-empty-output: true
- name: Upload SPM to CodeCov.io
run: bash <(curl https://codecov.io/bash) -F spm -F macOS -F ${XCODE_NAME}
env:
Expand All @@ -138,20 +146,22 @@ jobs:
run: rm -rf .build
- name: Lint
run: ./scripts/lint.sh
if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }}
if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_16.1.app' }}
- name: Run iOS target tests
run: xcodebuild test -scheme IPSWDownloads -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v4
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }}
- name: Run watchOS target tests
run: xcodebuild test -scheme IPSWDownloads -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v4
with:
fail-on-empty-output: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
32 changes: 16 additions & 16 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattpolzin/OpenAPIKit",
"state" : {
"revision" : "283454875cc6e5b2801d184d65835b92252d1784",
"version" : "3.1.2"
"revision" : "5b5ee49624dda5b3e3b85aff184f44a007862fb7",
"version" : "3.3.0"
}
},
{
Expand All @@ -32,26 +32,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41",
"version" : "1.3.0"
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "d029d9d39c87bed85b1c50adee7c41795261a192",
"version" : "1.0.6"
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
"version" : "1.1.4"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types",
"state" : {
"revision" : "1827dc94bdab2eb5f2fc804e9b0cb43574282566",
"version" : "1.0.2"
"revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd",
"version" : "1.3.0"
}
},
{
Expand All @@ -68,35 +68,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-openapi-generator",
"state" : {
"revision" : "7992d77065f2787e7651cf6d9be9b99ad38f5166",
"version" : "1.2.1"
"revision" : "9727261219af435e7e668b8813187e9bf5d61927",
"version" : "1.4.0"
}
},
{
"identity" : "swift-openapi-runtime",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-openapi-runtime",
"state" : {
"revision" : "76951d77a0609599d2dc233e7e40808a74767c6a",
"version" : "1.3.2"
"revision" : "daa2fb54fe4a7f5187d7286047d5144c8cb97477",
"version" : "1.6.0"
}
},
{
"identity" : "swift-openapi-urlsession",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-openapi-urlsession",
"state" : {
"revision" : "aac0a8273fa1186641e0b336da3f1be01aa6a0eb",
"version" : "1.0.0"
"revision" : "9bf4c712ad7989d6a91dbe68748b8829a50837e4",
"version" : "1.0.2"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams",
"state" : {
"revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3",
"version" : "5.0.6"
"revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d",
"version" : "5.1.3"
}
}
],
Expand Down
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ let package = Package(
.enableUpcomingFeature("ImplicitOpenExistentials"),
.enableUpcomingFeature("StrictConcurrency"),
.enableUpcomingFeature("DisableOutwardActorInference"),
.enableExperimentalFeature("StrictConcurrency")
.enableExperimentalFeature("StrictConcurrency"),
.enableExperimentalFeature("AccessLevelOnImport")
]
),
.testTarget(
Expand Down
70 changes: 70 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// swift-tools-version: 6.0
// swiftlint:disable explicit_acl explicit_top_level_acl
import PackageDescription

let swiftSettings: [SwiftSetting] = [
SwiftSetting.enableExperimentalFeature("AccessLevelOnImport"),
SwiftSetting.enableExperimentalFeature("BitwiseCopyable"),
SwiftSetting.enableExperimentalFeature("GlobalActorIsolatedTypesUsability"),
SwiftSetting.enableExperimentalFeature("IsolatedAny"),
SwiftSetting.enableExperimentalFeature("MoveOnlyPartialConsumption"),
SwiftSetting.enableExperimentalFeature("NestedProtocols"),
SwiftSetting.enableExperimentalFeature("NoncopyableGenerics"),
SwiftSetting.enableExperimentalFeature("RegionBasedIsolation"),
SwiftSetting.enableExperimentalFeature("TransferringArgsAndResults"),
SwiftSetting.enableExperimentalFeature("VariadicGenerics"),

SwiftSetting.enableUpcomingFeature("FullTypedThrows"),
SwiftSetting.enableUpcomingFeature("InternalImportsByDefault")

// SwiftSetting.unsafeFlags([
// "-Xfrontend",
// "-warn-long-function-bodies=100"
// ]),
// SwiftSetting.unsafeFlags([
// "-Xfrontend",
// "-warn-long-expression-type-checking=100"
// ])
]

let package = Package(
name: "IPSWDownloads",
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1)],
products: [
.library(name: "IPSWDownloads", targets: ["IPSWDownloads"])
],
dependencies: [
.package(
url: "https://github.com/brightdigit/OperatingSystemVersion",
from: "1.0.0-beta.1"
),
.package(
url: "https://github.com/apple/swift-openapi-generator",
from: "1.0.0"
),
.package(
url: "https://github.com/apple/swift-openapi-runtime",
from: "1.0.0"
),
.package(
url: "https://github.com/apple/swift-openapi-urlsession",
from: "1.0.0"
)
],
targets: [
.target(
name: "IPSWDownloads",
dependencies: [
.product(name: "OperatingSystemVersion", package: "OperatingSystemVersion"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession")
],
swiftSettings: swiftSettings
),
.testTarget(
name: "IPSWDownloadsTests",
dependencies: ["IPSWDownloads"]
)
]
)
// swiftlint:enable explicit_acl explicit_top_level_acl
2 changes: 1 addition & 1 deletion Sources/IPSWDownloads/Board.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
public import Foundation

/// A struct representing a board with configuration details.
public struct Board: Sendable, Codable, Hashable, Equatable {
Expand Down
3 changes: 2 additions & 1 deletion Sources/IPSWDownloads/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
public import Foundation

extension Data {
internal init(hexString: String) throws {
var data = Data(capacity: hexString.count / 2)
Expand Down
Loading

0 comments on commit f49b4c9

Please sign in to comment.