File tree Expand file tree Collapse file tree 8 files changed +83
-12
lines changed Expand file tree Collapse file tree 8 files changed +83
-12
lines changed Original file line number Diff line number Diff line change 77
88jobs :
99 build :
10- runs-on : macos-11
10+ strategy :
11+ fail-fast : false
12+ matrix :
13+ os : [macos-11, ubuntu-20.04]
14+
15+ runs-on : ${{ matrix.os }}
1116 env :
1217 DEVELOPER_DIR : /Applications/Xcode_13.2.1.app/Contents/Developer
1318
1419 steps :
1520 - uses : actions/checkout@v2
16- - name : Build
21+ - name : Release Build
1722 run : make build
1823
1924 test :
20- runs-on : macos-11
25+ strategy :
26+ fail-fast : false
27+ matrix :
28+ os : [macos-11, ubuntu-20.04]
29+
30+ runs-on : ${{ matrix.os }}
2131 env :
2232 DEVELOPER_DIR : /Applications/Xcode_13.2.1.app/Contents/Developer
2333
@@ -27,13 +37,18 @@ jobs:
2737 run : make test
2838
2939 install :
30- runs-on : macos-11
40+ strategy :
41+ fail-fast : false
42+ matrix :
43+ os : [macos-11, ubuntu-20.04]
44+
45+ runs-on : ${{ matrix.os }}
3146 env :
3247 DEVELOPER_DIR : /Applications/Xcode_13.2.1.app/Contents/Developer
3348
3449 steps :
3550 - uses : actions/checkout@v2
3651 - name : Install
37- run : make install
52+ run : env prefix=/tmp make install
3853 - name : Uninstall
39- run : make uninstall
54+ run : env prefix=/tmp make uninstall
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ let package = Package(
3636 ]
3737 ) ,
3838 . testTarget(
39- name: " ReleaseNotesCoreTests " ,
39+ name: " ReleaseNotesTests " ,
4040 dependencies: [ " ReleaseNotesCore " ]
4141 ) ,
4242 ]
Original file line number Diff line number Diff line change 11import ArgumentParser
22
33
4- @main
5- struct App {
6- static func main( ) async {
4+ public struct App {
5+ public static func main( ) async {
76 await ReleaseNotes . main ( )
87 }
98}
Original file line number Diff line number Diff line change 11import Parsing
22import SemanticVersion
3- import Darwin
43
54
65enum Parser {
Original file line number Diff line number Diff line change 1+ import Foundation
2+ import ReleaseNotesCore
3+
4+
5+ let group = DispatchGroup ( )
6+ group. enter ( )
7+ Task {
8+ defer { group. leave ( ) }
9+ await App . main ( )
10+ }
11+
12+ group. wait ( )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import XCTest
2+ import class Foundation. Bundle
3+
4+
5+ final class LaunchTests : XCTestCase {
6+
7+ func test_launch( ) throws {
8+ let process = Process ( )
9+ process. executableURL = productsDirectory
10+ . appendingPathComponent ( " swift-release-notes " )
11+ process. arguments = [ " --help " ]
12+
13+ let pipe = Pipe ( )
14+ process. standardOutput = pipe
15+
16+ try process. run ( )
17+ process. waitUntilExit ( )
18+
19+ let data = pipe. fileHandleForReading. readDataToEndOfFile ( )
20+ let output = try XCTUnwrap ( String ( data: data, encoding: . utf8) )
21+
22+ XCTAssertEqual ( output, """
23+ USAGE: release-notes [<working-direcory>]
24+
25+ ARGUMENTS:
26+ <working-direcory> (default: .)
27+
28+ OPTIONS:
29+ -h, --help Show help information.
30+
31+
32+ """ )
33+ }
34+
35+ /// Returns path to the built products directory.
36+ var productsDirectory : URL {
37+ #if os(macOS)
38+ for bundle in Bundle . allBundles where bundle. bundlePath. hasSuffix ( " .xctest " ) {
39+ return bundle. bundleURL. deletingLastPathComponent ( )
40+ }
41+ fatalError ( " couldn't find the products directory " )
42+ #else
43+ return Bundle . main. bundleURL
44+ #endif
45+ }
46+
47+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments