Skip to content

Commit

Permalink
raised minimum swift version to 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Jun 10, 2020
1 parent 21142da commit ddb15e9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 187 deletions.
201 changes: 23 additions & 178 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------------------------------------------------------------------------------
# This workflow was automatically generated by Action Status 1.0 (213).
# This workflow was automatically generated by Action Status 1.0.2 (310).
# (see https://actionstatus.elegantchaos.com for more details)
# --------------------------------------------------------------------------------

Expand All @@ -9,64 +9,31 @@ on: [push, pull_request]

jobs:

macOS-swift-51:
name: macOS (Swift 5.1)
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Build (Release)
run: swift build -c release
- name: Test (Release)
run: swift test --configuration release -Xswiftc -enable-testing
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'macOS (Swift 5.1)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}


macOS-swift-52:
name: macOS (Swift 5.2 Nightly)
name: macOS (Swift 5.2)
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Install Toolchain
- name: Xcode Version
run: |
branch="swift-5.2-branch"
wget --quiet https://swift.org/builds/$branch/xcode/latest-build.yml
grep "download:" < latest-build.yml > filtered.yml
sed -e 's/-osx.pkg//g' filtered.yml > stripped.yml
sed -e 's/:[^:\/\/]/YML="/g;s/$/"/g;s/ *=/=/g' stripped.yml > snapshot.sh
source snapshot.sh
echo "Installing Toolchain: $downloadYML"
wget --quiet https://swift.org/builds/$branch/xcode/$downloadYML/$downloadYML-osx.pkg
sudo installer -pkg $downloadYML-osx.pkg -target /
ln -s "/Library/Developer/Toolchains/$downloadYML.xctoolchain/usr/bin" swift-latest
export PATH="swift-latest:$PATH"
sudo xcode-select -s /Applications/Xcode_11.4.app
xcodebuild -version
swift --version
- name: Swift Version
run: swift --version
- name: Build (Release)
run: export PATH="swift-latest:$PATH"; swift build -c release
run: swift build -c release
- name: Test (Release)
run: export PATH="swift-latest:$PATH"; swift test --configuration release -Xswiftc -enable-testing --enable-test-discovery
run: swift test --configuration release -Xswiftc -enable-testing --enable-test-discovery
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'macOS (Swift 5.2 Nightly)'
job_name: 'macOS (Swift 5.2)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}

Expand All @@ -77,8 +44,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Install Toolchain
Expand All @@ -94,7 +59,12 @@ jobs:
sudo installer -pkg $downloadYML-osx.pkg -target /
ln -s "/Library/Developer/Toolchains/$downloadYML.xctoolchain/usr/bin" swift-latest
export PATH="swift-latest:$PATH"
- name: Xcode Version
run: |
xcodebuild -version
swift --version
- name: Swift Version
run: swift --version
- name: Build (Release)
run: export PATH="swift-latest:$PATH"; swift build -c release
- name: Test (Release)
Expand All @@ -109,42 +79,17 @@ jobs:
url: ${{ secrets.SLACK_WEBHOOK }}


linux-swift-51:
name: Linux (Swift 5.1)
runs-on: ubuntu-latest
container: swift:5.1
linux-swift-52:
name: Linux (Swift 5.2)
runs-on: ubuntu-18.04
container: swift:5.2.3-bionic
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Build (Release)
run: swift build -c release
- name: Test (Release)
run: swift test --configuration release -Xswiftc -enable-testing
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'Linux (Swift 5.1)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}


linux-swift-52:
name: Linux (Swift 5.2 Nightly)
runs-on: ubuntu-latest
container: swiftlang/swift:nightly-5.2
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Build (Release)
run: swift build -c release
- name: Test (Release)
Expand All @@ -154,132 +99,32 @@ jobs:
if: always()
with:
type: ${{ job.status }}
job_name: 'Linux (Swift 5.2 Nightly)'
job_name: 'Linux (Swift 5.2)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}


linux-swift-nightly:
name: Linux (Swift Development Nightly)
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
container: swiftlang/swift:nightly
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Build (Release)
run: swift build -c release
- name: Test (Release)
run: swift test --configuration release -Xswiftc -enable-testing --enable-test-discovery
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'Linux (Swift Development Nightly)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}


xcode-swift-51:
name: Xcode (Swift 5.1)
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Build (Release)
run: swift build -c release
- name: Test (Release)
run: swift test --configuration release -Xswiftc -enable-testing
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'Xcode (Swift 5.1)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}


xcode-swift-52:
name: Xcode (Swift 5.2 Nightly)
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Install Toolchain
run: |
branch="swift-5.2-branch"
wget --quiet https://swift.org/builds/$branch/xcode/latest-build.yml
grep "download:" < latest-build.yml > filtered.yml
sed -e 's/-osx.pkg//g' filtered.yml > stripped.yml
sed -e 's/:[^:\/\/]/YML="/g;s/$/"/g;s/ *=/=/g' stripped.yml > snapshot.sh
source snapshot.sh
echo "Installing Toolchain: $downloadYML"
wget --quiet https://swift.org/builds/$branch/xcode/$downloadYML/$downloadYML-osx.pkg
sudo installer -pkg $downloadYML-osx.pkg -target /
ln -s "/Library/Developer/Toolchains/$downloadYML.xctoolchain/usr/bin" swift-latest
export PATH="swift-latest:$PATH"
swift --version
- name: Build (Release)
run: export PATH="swift-latest:$PATH"; swift build -c release
- name: Test (Release)
run: export PATH="swift-latest:$PATH"; swift test --configuration release -Xswiftc -enable-testing --enable-test-discovery
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'Xcode (Swift 5.2 Nightly)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}


xcode-swift-nightly:
name: Xcode (Swift Development Nightly)
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Install Toolchain
run: |
branch="development"
wget --quiet https://swift.org/builds/$branch/xcode/latest-build.yml
grep "download:" < latest-build.yml > filtered.yml
sed -e 's/-osx.pkg//g' filtered.yml > stripped.yml
sed -e 's/:[^:\/\/]/YML="/g;s/$/"/g;s/ *=/=/g' stripped.yml > snapshot.sh
source snapshot.sh
echo "Installing Toolchain: $downloadYML"
wget --quiet https://swift.org/builds/$branch/xcode/$downloadYML/$downloadYML-osx.pkg
sudo installer -pkg $downloadYML-osx.pkg -target /
ln -s "/Library/Developer/Toolchains/$downloadYML.xctoolchain/usr/bin" swift-latest
export PATH="swift-latest:$PATH"
swift --version
- name: Build (Release)
run: export PATH="swift-latest:$PATH"; swift build -c release
- name: Test (Release)
run: export PATH="swift-latest:$PATH"; swift test --configuration release -Xswiftc -enable-testing --enable-test-discovery
run: swift test --configuration release -Xswiftc -enable-testing --enable-test-discovery
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'Xcode (Swift Development Nightly)'
job_name: 'Linux (Swift Development Nightly)'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}

8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"repositoryURL": "https://github.com/elegantchaos/SemanticVersion.git",
"state": {
"branch": null,
"revision": "fe174904ce8a070a3ca52e8b7e25193f3a004d66",
"version": "1.0.3"
"revision": "6bda5a45a2f687a82a0fbb002bee8ad31e44f478",
"version": "1.1.0"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "8d31a0905c346a45c87773ad50862b5b3df8dff6",
"version": "0.0.4"
"revision": "3d79b2b5a2e5af52c14e462044702ea7728f5770",
"version": "0.1.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.2

import PackageDescription

Expand All @@ -12,7 +12,7 @@ let package = Package(
.executable(name: "CommandShellExample", targets: ["CommandShellExample"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.0.4"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.1.0"),
.package(url: "https://github.com/elegantchaos/Logger.git", from: "1.5.3"),
.package(url: "https://github.com/elegantchaos/SemanticVersion.git", from: "1.1.0"),
.package(url: "https://github.com/elegantchaos/XCTestExtensions.git", from: "1.1.1"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/CommandShell/CommandShell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public struct CommandShell<Engine: CommandEngine>: ParsableCommand {
}

do {
let command = try parseAsRoot()
var command = try parseAsRoot()
try command.run()
Logger.defaultManager.flush()
exit()
Expand Down
3 changes: 1 addition & 2 deletions Tests/CommandShellTests/CommandShellTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ final class CommandShellTests: XCTestCase {
SUBCOMMANDS:
subcommand
See 'CommandShellExample help <subcommand>' for detailed help.
"""

func testNoCommands() {
let runner = XCTestRunner(for: productsDirectory.appendingPathComponent("CommandShellExample"))
// print(runner)
let result = runner.run()
// let result = run("CommandShellExample")
XCTAssertResult(result, status: 0, stdout: help, stderr: "")
}

Expand Down

0 comments on commit ddb15e9

Please sign in to comment.