Skip to content

Commit 2f459e0

Browse files
committed
Initial commit
0 parents  commit 2f459e0

File tree

104 files changed

+7824
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+7824
-0
lines changed
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
10+
permissions:
11+
contents: read
12+
id-token: write
13+
pages: write
14+
15+
# Allow one concurrent deployment. Do not cancel in-flight deployments because we don't want assets to be in a
16+
# a semi-deployed state.
17+
concurrency:
18+
group: "deploy-documentation"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
deploy-documentation:
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
runs-on: macos-15
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
- name: Set Up GitHub Pages
31+
uses: actions/configure-pages@v3
32+
- name: Build Documentation
33+
run: |
34+
xcodebuild docbuild \
35+
-scheme PersistentKeyValueKit \
36+
-derivedDataPath /tmp/DerivedData \
37+
-destination 'generic/platform=iOS';
38+
mkdir _site;
39+
$(xcrun --find docc) process-archive \
40+
transform-for-static-hosting /tmp/DerivedData/Build/Products/Debug-iphoneos/PersistentKeyValueKit.doccarchive \
41+
--hosting-base-path PersistentKeyValueKit \
42+
--output-path _site;
43+
- name: Create index.html
44+
run: |
45+
echo "<script>window.location.href += \"/documentation/persistentkeyvaluekit\"</script>" > _site/index.html;
46+
- name: Upload Documentation Artifact to GitHub Pages
47+
uses: actions/upload-pages-artifact@v1
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v2

.github/workflows/test.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.ref_name }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
get-environment-details:
16+
strategy:
17+
matrix:
18+
include:
19+
- os: macos-15
20+
xcode: '16.0'
21+
name: Get Environment Details (Xcode ${{ matrix.xcode }})
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- name: Select Xcode
25+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
26+
27+
- name: Print OS SDKs
28+
run: xcodebuild -version -sdk
29+
30+
- name: Print simulators
31+
run: |
32+
xcrun simctl delete unavailable
33+
xcrun simctl list
34+
35+
test:
36+
needs: get-environment-details
37+
strategy:
38+
matrix:
39+
include:
40+
- os: macos-15
41+
xcode: '16.0'
42+
platform: iOS
43+
destination: "name=iPhone 16 Pro"
44+
sdk: iphonesimulator
45+
- os: macos-15
46+
xcode: '16.0'
47+
platform: tvOS
48+
destination: "name=Apple TV 4K (3rd generation)"
49+
sdk: appletvsimulator
50+
- os: macos-15
51+
xcode: '16.0'
52+
platform: visionOS
53+
destination: "name=Apple Vision Pro"
54+
sdk: xrsimulator
55+
- os: macos-15
56+
xcode: '16.0'
57+
platform: watchOS
58+
destination: "name=Apple Watch Ultra 2 (49mm)"
59+
sdk: watchsimulator
60+
- os: macos-15
61+
xcode: '16.0'
62+
platform: macOS
63+
name: Test ${{ matrix.platform }} (Xcode ${{ matrix.xcode }})
64+
runs-on: ${{ matrix.os }}
65+
steps:
66+
- name: Checkout project
67+
uses: actions/checkout@master
68+
69+
- name: Select Xcode
70+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
71+
72+
- name: Run tests (Xcode)
73+
if: matrix.platform != 'macOS'
74+
run: |
75+
set -o pipefail
76+
xcodebuild clean test -scheme PersistentKeyValueKit -sdk ${{ matrix.sdk }} -destination "${{ matrix.destination }}" -configuration Debug -enableCodeCoverage YES | xcpretty -c
77+
78+
- name: Run tests (Swift)
79+
if: matrix.platform == 'macOS'
80+
run: swift test

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/
7+
.netrc

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2024 Kyle Hughes
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package.swift

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "PersistentKeyValueKit",
7+
platforms: [
8+
.iOS(.v15),
9+
.macOS(.v12),
10+
.tvOS(.v15),
11+
.visionOS(.v1),
12+
.watchOS(.v8),
13+
],
14+
products: [
15+
.library(
16+
name: "PersistentKeyValueKit",
17+
targets: [
18+
"PersistentKeyValueKit",
19+
]
20+
),
21+
],
22+
targets: [
23+
.target(
24+
name: "PersistentKeyValueKit"
25+
),
26+
.testTarget(
27+
name: "PersistentKeyValueKitTests",
28+
dependencies: [
29+
"PersistentKeyValueKit",
30+
]
31+
),
32+
]
33+
)

0 commit comments

Comments
 (0)