Skip to content
Draft
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
88 changes: 88 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Swift SDK

on:
push:
branches: [master, main]
paths:
- 'swift/**'
- 'meta/**'
- 'test-assets/**'
- '.github/workflows/swift.yml'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [master, main]
paths:
- 'swift/**'
- 'meta/**'
- 'test-assets/**'
- '.github/workflows/swift.yml'

permissions:
contents: read

jobs:
test-macos:
name: Test Swift on macOS
runs-on: macos-14

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Show Swift version
run: swift --version

- name: Build
working-directory: swift
run: swift build -v

- name: Run tests
working-directory: swift
run: swift test -v

test-linux:
name: Test Swift on Linux
runs-on: ubuntu-latest

container:
image: swift:5.10

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Show Swift version
run: swift --version

- name: Build
working-directory: swift
run: swift build -v

- name: Run tests
working-directory: swift
run: swift test -v

lint:
name: Lint
runs-on: macos-14

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build
working-directory: swift
run: swift build -v

# SwiftLint is typically used for linting Swift code
# Uncomment when swiftlint configuration is added
# - name: Install SwiftLint
# run: brew install swiftlint
#
# - name: Run SwiftLint
# working-directory: swift
# run: swiftlint lint --strict
21 changes: 21 additions & 0 deletions swift/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Swift Package Manager
.build/
.swiftpm/
Package.resolved

# Xcode
*.xcodeproj/
*.xcworkspace/
xcuserdata/
*.playground/

# DerivedData
DerivedData/

# Swift Package Manager support
Packages/
.packages/

# IDE
.idea/
*.xcuserstate
27 changes: 27 additions & 0 deletions swift/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "JSONStructure",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v6)
],
products: [
.library(
name: "JSONStructure",
targets: ["JSONStructure"]),
],
targets: [
.target(
name: "JSONStructure",
dependencies: []),
.testTarget(
name: "JSONStructureTests",
dependencies: ["JSONStructure"]),
]
)
Loading