Skip to content

Commit 834a28e

Browse files
committed
Initial commit
0 parents  commit 834a28e

30 files changed

+2894
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- "*"
9+
10+
jobs:
11+
12+
"tuxOS-Tests":
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
images:
17+
- swift:5.1
18+
- swiftlang/swift:nightly-5.2
19+
container:
20+
image: ${{ matrix.images }}
21+
volumes:
22+
- $GITHUB_WORKSPACE:/src
23+
options: --workdir /src
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v1
27+
with:
28+
fetch-depth: 1
29+
- name: Test
30+
run: swift test --enable-code-coverage --enable-test-discovery
31+
- name: Convert coverage files
32+
run: llvm-cov export -format="lcov" .build/debug/pure-swift-jsonPackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov
33+
- name: Upload to codecov.io
34+
uses: codecov/codecov-action@v1.0.3
35+
with:
36+
token: ${{secrets.CODECOV_TOKEN}}
37+
file: info.lcov
38+
39+
"tuxOS-Performance-Tests":
40+
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
images:
44+
- swift:5.1
45+
- swiftlang/swift:nightly-5.2
46+
container:
47+
image: ${{ matrix.images }}
48+
volumes:
49+
- $GITHUB_WORKSPACE:/src
50+
options: --workdir /src
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v1
54+
with:
55+
fetch-depth: 1
56+
- name: Build
57+
run: swift build -c release
58+
working-directory: ./PerfTests
59+
- name: Run test
60+
run: .build/release/PureSwiftJSONCodingPerfTests
61+
working-directory: ./PerfTests
62+
63+
"macOS-Tests":
64+
runs-on: macOS-latest
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v1
68+
with:
69+
fetch-depth: 1
70+
- name: Show all Xcode versions
71+
run: ls -an /Applications/ | grep Xcode*
72+
- name: Change Xcode command line tools
73+
run: sudo xcode-select -s /Applications/Xcode_11.3.app/Contents/Developer
74+
- name: Swift version
75+
run: swift --version
76+
# - name: SPM Build
77+
# run: swift build
78+
# - name: SPM Tests
79+
# run: swift test --parallel -Xswiftc -DDEBUG
80+
- name: Xcode Tests
81+
run: |
82+
swift package generate-xcodeproj
83+
xcodebuild -quiet -parallel-testing-enabled YES -scheme pure-swift-json-Package -enableCodeCoverage YES build test
84+
- name: Codecov
85+
run: bash <(curl -s https://codecov.io/bash) -t ${{secrets.CODECOV_TOKEN}} -f *.coverage.txt
86+
87+
"macOS-Performance-Tests":
88+
runs-on: macOS-latest
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v1
92+
with:
93+
fetch-depth: 1
94+
- name: Build
95+
run: swift build -c release
96+
working-directory: ./PerfTests
97+
- name: Run test
98+
run: .build/release/PureSwiftJSONCodingPerfTests
99+
working-directory: ./PerfTests

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
.build
3+
/*.xcodeproj
4+
xcuserdata

Package.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// swift-tools-version:5.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
var package = Package(
7+
name: "pure-swift-json",
8+
products: [
9+
.library(
10+
name: "PureSwiftJSONCoding",
11+
targets: ["PureSwiftJSONCoding"]),
12+
.library(
13+
name: "PureSwiftJSONParsing",
14+
targets: ["PureSwiftJSONParsing"]),
15+
],
16+
dependencies: [
17+
18+
],
19+
targets: [
20+
.target(
21+
name: "PureSwiftJSONCoding",
22+
dependencies: ["PureSwiftJSONParsing"]),
23+
.target(
24+
name: "PureSwiftJSONParsing",
25+
dependencies: []),
26+
.testTarget(
27+
name: "JSONCodingTests",
28+
dependencies: ["PureSwiftJSONCoding"]),
29+
.testTarget(
30+
name: "JSONParsingTests",
31+
dependencies: ["PureSwiftJSONParsing"]),
32+
]
33+
)
34+

PerfTests/Package.resolved

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PerfTests/Package.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// swift-tools-version:5.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
var package = Package(
7+
name: "pure-swift-json-performance",
8+
products: [
9+
10+
],
11+
dependencies: [
12+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.13.0"),
13+
.package(url: "https://github.com/autimatisering/IkigaJSON.git", from: "2.0.0"),
14+
.package(path: "..")
15+
],
16+
targets: [
17+
.target(
18+
name: "PureSwiftJSONCodingPerfTests",
19+
dependencies: ["PureSwiftJSONCoding", "PureSwiftJSONParsing", "NIO", "NIOFoundationCompat", "IkigaJSON"]),
20+
]
21+
)
22+
23+
#if os(macOS)
24+
package.dependencies.append(.package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "5.0.0"))
25+
package.targets.last?.dependencies.append("SwiftyJSON")
26+
#endif

0 commit comments

Comments
 (0)