This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +62
-14
lines changed Expand file tree Collapse file tree 5 files changed +62
-14
lines changed Original file line number Diff line number Diff line change 1+ name : Homebrew CI
2+
3+ on :
4+ push :
5+ branches : [master]
6+ schedule :
7+ - cron : 0 0 * * *
8+
9+ jobs :
10+ homebrew-bottle :
11+ runs-on : macos-10.15
12+ name : Test Homebrew installation from bottle
13+
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v1
17+ - uses : actions/cache@v2
18+ with :
19+ path : .build
20+ key : ${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
21+ restore-keys : |
22+ ${{ runner.os }}-spm-xcode-${{ matrix.xcode }}-
23+ - name : Install swift-doc
24+ run : brew install swiftdocorg/formulae/swift-doc --force-bottle
25+ - name : Run Tests
26+ run : |
27+ swift test --filter EndToEndTests. -Xswiftc -DUSE_HOMEBREW
28+
29+ homebrew-sources :
30+ runs-on : macos-11.0
31+
32+ name : Test Homebrew installation from sources
33+ steps :
34+ - name : Checkout
35+ uses : actions/checkout@v1
36+ - uses : actions/cache@v2
37+ with :
38+ path : .build
39+ key : ${{ runner.os }}-spm-xcode-${{ hashFiles('**/Package.resolved') }}
40+ restore-keys : |
41+ ${{ runner.os }}-spm-xcode-
42+ - name : Install swift-doc
43+ run : brew install swiftdocorg/formulae/swift-doc --build-from-source
44+ - name : Run Tests
45+ run : swift test --filter EndToEndTests. -Xswiftc -DUSE_HOMEBREW
Original file line number Diff line number Diff line change @@ -2,12 +2,10 @@ import XCTest
22
33final class CoverageSubcommandTests : XCTestCase {
44 func testStandardOutput( ) throws {
5- let command = Bundle . productsDirectory. appendingPathComponent ( " swift-doc " )
6-
75 let outputDirectory = try temporaryDirectory ( )
86 defer { try ? FileManager . default. removeItem ( at: outputDirectory) }
97
10- try Process . run ( command: command ,
8+ try Process . run ( command: swiftDocCommand ,
119 arguments: [
1210 " coverage " ,
1311 " Sources "
@@ -20,13 +18,11 @@ final class CoverageSubcommandTests: XCTestCase {
2018 }
2119
2220 func testFileOutput( ) throws {
23- let command = Bundle . productsDirectory. appendingPathComponent ( " swift-doc " )
24-
2521 let outputDirectory = try temporaryDirectory ( )
2622 let outputFile = outputDirectory. appendingPathComponent ( " report.json " )
2723 defer { try ? FileManager . default. removeItem ( at: outputDirectory) }
2824
29- try Process . run ( command: command ,
25+ try Process . run ( command: swiftDocCommand ,
3026 arguments: [
3127 " coverage " ,
3228 " --output " , outputFile. path,
Original file line number Diff line number Diff line change @@ -2,12 +2,10 @@ import XCTest
22
33final class DiagramSubcommandTests : XCTestCase {
44 func testStandardOutput( ) throws {
5- let command = Bundle . productsDirectory. appendingPathComponent ( " swift-doc " )
6-
75 let outputDirectory = try temporaryDirectory ( )
86 defer { try ? FileManager . default. removeItem ( at: outputDirectory) }
97
10- try Process . run ( command: command ,
8+ try Process . run ( command: swiftDocCommand ,
119 arguments: [
1210 " diagram " ,
1311 " Sources "
Original file line number Diff line number Diff line change @@ -2,12 +2,10 @@ import XCTest
22
33final class GenerateSubcommandTests : XCTestCase {
44 func testCommonMark( ) throws {
5- let command = Bundle . productsDirectory. appendingPathComponent ( " swift-doc " )
6-
75 let outputDirectory = try temporaryDirectory ( )
86 defer { try ? FileManager . default. removeItem ( at: outputDirectory) }
97
10- try Process . run ( command: command ,
8+ try Process . run ( command: swiftDocCommand ,
119 arguments: [
1210 " generate " ,
1311 " --module-name " , " SwiftDoc " ,
@@ -44,11 +42,10 @@ final class GenerateSubcommandTests: XCTestCase {
4442 }
4543
4644 func testHTML( ) throws {
47- let command = Bundle . productsDirectory. appendingPathComponent ( " swift-doc " )
4845 let outputDirectory = try temporaryDirectory ( )
4946
5047 defer { try ? FileManager . default. removeItem ( at: outputDirectory) }
51- try Process . run ( command: command ,
48+ try Process . run ( command: swiftDocCommand ,
5249 arguments: [
5350 " generate " ,
5451 " --module-name " , " SwiftDoc " ,
Original file line number Diff line number Diff line change 1+ import XCTest
2+ import Foundation
3+
4+ extension XCTestCase {
5+ var swiftDocCommand : URL {
6+ #if USE_HOMEBREW
7+ return URL ( fileURLWithPath: " /usr/local/bin/swift-doc " )
8+ #else
9+ return Bundle . productsDirectory. appendingPathComponent ( " swift-doc " )
10+ #endif
11+ }
12+ }
You can’t perform that action at this time.
0 commit comments