Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable comfortable Swift Package development #414

Merged
merged 12 commits into from
Sep 26, 2021
61 changes: 4 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,12 @@ on:
- master

jobs:
test-on-macos:
name: Test on macOS
runs-on: macOS-latest
strategy:
matrix:
xcode: ["11.4", "12.3"]
steps:
- uses: actions/checkout@v2

- name: Select Xcode
run: |
xcodebuild -version
ls -nt /Applications/ | grep "Xcode*"
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
xcodebuild -version

- name: Install danger-js
run: brew install danger/tap/danger-js

- run: swift test

- run: swift run danger-swift ci --verbose --failOnErrors
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-on-macos-11:
name: Test on macOS
runs-on: macOS-11
strategy:
matrix:
xcode: ["12.5", "13.0"]
xcode: ["12.4", "12.5", "13.0"]
steps:
- uses: actions/checkout@v2

Expand All @@ -65,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["5.2.4", "5.3.3"]
swift: ["5.3.3"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -86,38 +60,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-without-spm-on-macos:
name: Test without SPM on macOS
runs-on: macOS-latest
strategy:
matrix:
xcode: ["11.4", "12.3"]
steps:
- uses: actions/checkout@v2

- name: Select Xcode
run: |
xcodebuild -version
ls -nt /Applications/ | grep "Xcode*"
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
xcodebuild -version

- name: Install danger-js
run: brew install danger/tap/danger-js

- run: make install

- run: danger-swift ci --verbose --failOnErrors
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-without-spm-on-macos-11:
name: Test without SPM on macOS
runs-on: macOS-11
strategy:
matrix:
xcode: ["12.5", "13.0"]
xcode: ["12.4", "12.5", "13.0"]
steps:
- uses: actions/checkout@v2

Expand All @@ -143,7 +91,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["5.2.4", "5.3.3"]
swift: ["5.3.3"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -165,4 +113,3 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.4
5.3
103 changes: 38 additions & 65 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,35 @@
"repositoryURL": "https://github.com/SwiftDocOrg/CommonMark.git",
"state": {
"branch": null,
"revision": "62176a332884826997928ba578d9d322c16772fb",
"version": "0.4.0"
}
},
{
"package": "CwlCatchException",
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git",
"state": {
"branch": null,
"revision": "7cd2f8cacc4d22f21bc0b2309c3b18acf7957b66",
"version": "1.2.0"
}
},
{
"package": "CwlPreconditionTesting",
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git",
"state": {
"branch": null,
"revision": "c228db5d2ad1b01ebc84435e823e6cca4e3db98b",
"version": "1.2.0"
"revision": "92fa2fa2bf3c598f23da652e78c2d4b5bc4e35e9",
"version": "0.5.1"
}
},
{
"package": "GraphViz",
"repositoryURL": "https://github.com/SwiftDocOrg/GraphViz.git",
"state": {
"branch": null,
"revision": "c4746cb3ff6f5e7c5d5540c40b98555521c3ee43",
"version": "0.1.3"
"revision": "74b6cbd8c5ecea9f64d84c4e1c88d65604dd033f",
"version": "0.4.1"
}
},
{
"package": "HypertextLiteral",
"repositoryURL": "https://github.com/NSHipster/HypertextLiteral.git",
"state": {
"branch": null,
"revision": "3e45da849e507d171c7264146176bb834a01be4f",
"version": "0.0.2"
"revision": "3993d13c1e1d72a2ab20316646b2d53a705b17d0",
"version": "0.0.3"
}
},
{
"package": "Komondor",
"repositoryURL": "https://github.com/shibapm/Komondor",
"state": {
"branch": null,
"revision": "855c74f395a4dc9e02828f58d931be6920bcbf6f",
"version": "1.0.6"
"revision": "1bb467ad7ad57e94af82d73fa0fe063cb0b8ddd5",
"version": "1.1.0"
}
},
{
Expand All @@ -78,17 +60,17 @@
"repositoryURL": "https://github.com/SwiftDocOrg/Markup.git",
"state": {
"branch": null,
"revision": "029ad8c1115ab32b7c20ab52eb092fbc030deb17",
"version": "0.0.4"
"revision": "7c6448d3f1af27270f429737ea31ba1517ed472f",
"version": "0.1.2"
}
},
{
"package": "Nimble",
"repositoryURL": "https://github.com/Quick/Nimble.git",
"state": {
"branch": null,
"revision": "b02b00b30b6353632aa4a5fb6124f8147f7140c0",
"version": "8.0.5"
"revision": "7a46a5fc86cb917f69e3daf79fcb045283d8f008",
"version": "8.1.2"
}
},
{
Expand All @@ -114,8 +96,8 @@
"repositoryURL": "https://github.com/Quick/Quick.git",
"state": {
"branch": null,
"revision": "33682c2f6230c60614861dfc61df267e11a1602f",
"version": "2.2.0"
"revision": "09b3becb37cb2163919a3842a4c5fa6ec7130792",
"version": "2.2.1"
}
},
{
Expand Down Expand Up @@ -150,17 +132,17 @@
"repositoryURL": "https://github.com/jpsim/SourceKitten.git",
"state": {
"branch": null,
"revision": "97b5848e5692150d75b5cf0b81d7ebef5f4d5071",
"version": "0.28.0"
"revision": "77a4dbbb477a8110eb8765e3c44c70fb4929098f",
"version": "0.29.0"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "223d62adc52d51669ae2ee19bdb8b7d9fd6fcd9c",
"version": "0.0.6"
"revision": "9564d61b08a5335ae0a36f789a7d71493eacadfc",
"version": "0.3.2"
}
},
{
Expand All @@ -176,27 +158,18 @@
"package": "swift-doc",
"repositoryURL": "https://github.com/SwiftDocOrg/swift-doc",
"state": {
"branch": "1.0.0-beta.4",
"revision": "581af2fe50667ed2f49c53d26b91a8feb4531302",
"branch": "1.0.0-rc.1",
"revision": "f935ebfe524a0ff27bda07dadc3662e3e45b5125",
"version": null
}
},
{
"package": "HTMLEntities",
"repositoryURL": "https://github.com/IBM-Swift/swift-html-entities.git",
"state": {
"branch": null,
"revision": "2b14531d0c36dbb7c1c45a4d38db9c2e7898a307",
"version": "3.0.200"
}
},
{
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "74d7b91ceebc85daf387ebb206003f78813f71aa",
"version": "1.2.0"
"revision": "5d66f7ba25daf4f94100e7022febf3c75e37a6c7",
"version": "1.4.2"
}
},
{
Expand All @@ -213,16 +186,16 @@
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state": {
"branch": null,
"revision": "12c6a7ce9d67f39a23c6bab757bdb073bd997885",
"version": "1.7.1"
"revision": "f8a9c997c3c1dab4e216a8ec9014e23144cbab37",
"version": "1.9.0"
}
},
{
"package": "SwiftSyntax",
"repositoryURL": "https://github.com/apple/swift-syntax.git",
"state": {
"branch": "0.50200.0",
"revision": "0688b9cfc4c3dd234e4f55f1f056b2affc849873",
"branch": "0.50300.0",
"revision": "844574d683f53d0737a9c6d706c3ef31ed2955eb",
"version": null
}
},
Expand All @@ -231,35 +204,35 @@
"repositoryURL": "https://github.com/nicklockwood/SwiftFormat",
"state": {
"branch": null,
"revision": "d9b7cf39e06e89428004a767d97006fb6d293c53",
"version": "0.43.5"
"revision": "a9bdfd2548ebe518a693a5c6341d27c42b7e7a0a",
"version": "0.48.11"
}
},
{
"package": "SwiftLint",
"repositoryURL": "https://github.com/Realm/SwiftLint",
"state": {
"branch": null,
"revision": "76d44cff391645a7f4d5ba2bf1853afaf3f5c1fb",
"version": "0.38.2"
"revision": "da66a81710714112d51041264440987b992849c3",
"version": "0.40.0"
}
},
{
"package": "SwiftMarkup",
"repositoryURL": "https://github.com/SwiftDocOrg/SwiftMarkup.git",
"state": {
"branch": null,
"revision": "7915d17608dd32434dc8abb95156f70367f38a5a",
"version": "0.2.1"
"revision": "bc71bde93b5217833c8ed13d5cf1e0c60f1367a7",
"version": "0.3.0"
}
},
{
"package": "SwiftSemantics",
"repositoryURL": "https://github.com/SwiftDocOrg/SwiftSemantics.git",
"state": {
"branch": null,
"revision": "4fdc48bddbbb8311079ed111e5a4f2b92423b05c",
"version": "0.1.0"
"revision": "7690606eec5db6b089d6a5d252013ee07cade323",
"version": "0.3.2"
}
},
{
Expand All @@ -275,8 +248,8 @@
"package": "SwiftSyntaxHighlighter",
"repositoryURL": "https://github.com/NSHipster/SwiftSyntaxHighlighter.git",
"state": {
"branch": "1.0.0",
"revision": "4a20d10bba17241b66650d99081801536146b43c",
"branch": "1.2.2",
"revision": "175923d005df00dc76c3c191bd7977c066a5288c",
"version": null
}
},
Expand All @@ -294,8 +267,8 @@
"repositoryURL": "https://github.com/drmohundro/SWXMLHash.git",
"state": {
"branch": null,
"revision": "a4931e5c3bafbedeb1601d3bb76bbe835c6d475a",
"version": "5.0.1"
"revision": "9183170d20857753d4f331b0ca63f73c60764bf3",
"version": "5.0.2"
}
},
{
Expand Down
14 changes: 7 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.2
// swift-tools-version:5.3

import PackageDescription

Expand All @@ -9,7 +9,7 @@ let package = Package(
products: [
.library(name: "Danger", type: .dynamic, targets: ["Danger"]),
.library(name: "DangerFixtures", type: .dynamic, targets: ["DangerFixtures"]),
.library(name: "DangerDeps", type: .dynamic, targets: ["Danger-Swift"]), // dev
.library(name: "DangerDeps", type: .dynamic, targets: ["Danger-Swift"]),
.executable(name: "danger-swift", targets: ["Runner"]),
],
dependencies: [
Expand All @@ -23,19 +23,19 @@ let package = Package(
.package(url: "https://github.com/Realm/SwiftLint", from: "0.38.0"), // dev
.package(name: "SnapshotTesting", url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.7.1"), // dev
.package(url: "https://github.com/shibapm/Rocket", from: "0.4.0"), // dev
.package(url: "https://github.com/SwiftDocOrg/swift-doc", .branch("1.0.0-beta.4")), // dev
.package(url: "https://github.com/SwiftDocOrg/swift-doc", .branch("1.0.0-rc.1")), // dev
],
targets: [
.target(name: "Danger-Swift", dependencies: ["Danger"]), // dev
.target(name: "Danger-Swift", dependencies: ["Danger"]),
.target(name: "DangerShellExecutor"),
.target(name: "DangerDependenciesResolver", dependencies: ["DangerShellExecutor", "Version", "Logger"]),
.target(name: "Danger", dependencies: ["OctoKit", "Logger", "DangerShellExecutor"]),
.target(name: "RunnerLib", dependencies: ["Logger", "DangerShellExecutor"]),
.target(name: "Runner", dependencies: ["RunnerLib", "Logger", "DangerDependenciesResolver"]),
.target(name: "DangerFixtures", dependencies: ["Danger"]),
.testTarget(name: "DangerTests", dependencies: ["Danger", "DangerFixtures", "SnapshotTesting"]), // dev
.testTarget(name: "RunnerLibTests", dependencies: ["RunnerLib", "SnapshotTesting"]), // dev
.testTarget(name: "DangerDependenciesResolverTests", dependencies: ["DangerDependenciesResolver", "SnapshotTesting"]), // dev
.testTarget(name: "DangerTests", dependencies: ["Danger", "DangerFixtures", "SnapshotTesting"]), // dev
.testTarget(name: "RunnerLibTests", dependencies: ["RunnerLib", "SnapshotTesting"], exclude: ["__Snapshots__"]), // dev
.testTarget(name: "DangerDependenciesResolverTests", dependencies: ["DangerDependenciesResolver", "SnapshotTesting"], exclude: ["__Snapshots__"]), // dev
]
)

Expand Down
Loading