Add initial source code, with passing test
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7cf852379c
commit
7a9535bdfe
9
.drone.yml
Normal file
9
.drone.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: swift:4.2
|
||||
commands:
|
||||
- swift build
|
||||
- swift test
|
28
Package.swift
Normal file
28
Package.swift
Normal file
|
@ -0,0 +1,28 @@
|
|||
// swift-tools-version:4.2
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "drone-tutorial-swift",
|
||||
products: [
|
||||
// Products define the executables and libraries produced by a package, and make them visible to other packages.
|
||||
.library(
|
||||
name: "drone-tutorial-swift",
|
||||
targets: ["drone-tutorial-swift"]),
|
||||
],
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// .package(url: /* package url */, from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
|
||||
.target(
|
||||
name: "drone-tutorial-swift",
|
||||
dependencies: []),
|
||||
.testTarget(
|
||||
name: "drone-tutorial-swiftTests",
|
||||
dependencies: ["drone-tutorial-swift"]),
|
||||
]
|
||||
)
|
19
README.md
19
README.md
|
@ -1,3 +1,18 @@
|
|||
# drone-tutorial-swift
|
||||
# Drone Tutorial: Swift
|
||||
|
||||
This is a swimple Swift project to observe the Drone Continuous Delivery platform in action.
|
||||
This is a swimple Swift project to observe the Drone Continuous Delivery platform in action.
|
||||
|
||||
## Usage
|
||||
|
||||
* Clone this project
|
||||
* Set up a corresponding project on the Drone-equipped Git platform you want to try.
|
||||
* Push the `master` branch to your own project.
|
||||
* Log into drone. You should see a build getting created and succeeding.
|
||||
* Push the `bad_test` branch to your own project.
|
||||
* You should see a drone build getting created, and failing in the `test` stage.
|
||||
|
||||
## License
|
||||
|
||||
This is `CC0` licensed. Adapt it to whatever purpose you want. Have fun.
|
||||
|
||||
`microtherion@gmail.com` 2019-02-02
|
||||
|
|
3
Sources/drone-tutorial-swift/drone_tutorial_swift.swift
Normal file
3
Sources/drone-tutorial-swift/drone_tutorial_swift.swift
Normal file
|
@ -0,0 +1,3 @@
|
|||
struct drone_tutorial_swift {
|
||||
var text = "Hello, World!"
|
||||
}
|
7
Tests/LinuxMain.swift
Normal file
7
Tests/LinuxMain.swift
Normal file
|
@ -0,0 +1,7 @@
|
|||
import XCTest
|
||||
|
||||
import drone_tutorial_swiftTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += drone_tutorial_swiftTests.allTests()
|
||||
XCTMain(tests)
|
9
Tests/drone-tutorial-swiftTests/XCTestManifests.swift
Normal file
9
Tests/drone-tutorial-swiftTests/XCTestManifests.swift
Normal file
|
@ -0,0 +1,9 @@
|
|||
import XCTest
|
||||
|
||||
#if !os(macOS)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
return [
|
||||
testCase(drone_tutorial_swiftTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
import XCTest
|
||||
@testable import drone_tutorial_swift
|
||||
|
||||
final class drone_tutorial_swiftTests: XCTestCase {
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct
|
||||
// results.
|
||||
XCTAssertEqual(drone_tutorial_swift().text, "Hello, World!")
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testExample", testExample),
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user