Skip to content

Improve GitHub CI runtime #82

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

Merged
merged 15 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,15 @@ jobs:
- name: Install cocoapods dependencies
if: steps.cache-pods.outputs.cache-hit != 'true'
run: bundle exec pod install

- name: Build Swift Package
run: swift build -j 2 --disable-index-store -v

- name: Test Framework on iOS and tvOS
run: bundle exec fastlane ios test
run: bundle exec fastlane ios test ci:github

- name: Test Framework on macOS
run: bundle exec fastlane mac test
run: bundle exec fastlane mac test ci:github

- name: Lint podspec
run: bundle exec pod lib lint

- name: Build Swift Package
run: swift build -v

- name: Test Swift Package
run: swift test -v
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ source "https://rubygems.org"

gem "cocoapods", "1.10.1"
gem "fastlane", "~> 2.137"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
13 changes: 13 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ GEM
cocoapods-try (1.2.0)
colored (1.2)
colored2 (3.1.2)
colorize (0.8.1)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
concurrent-ruby (1.1.8)
Expand Down Expand Up @@ -130,6 +131,13 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-test_center (3.15.3)
colorize
json
plist
trainer
xcodeproj
xctest_list (>= 1.2.1)
ffi (1.15.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
Expand Down Expand Up @@ -209,6 +217,9 @@ GEM
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
trainer (0.9.1)
fastlane (>= 2.25.0)
plist (>= 3.1.0, < 4.0.0)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
Expand All @@ -233,13 +244,15 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
xctest_list (1.2.1)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.10.1)
fastlane (~> 2.137)
fastlane-plugin-test_center

BUNDLED WITH
1.17.3
3 changes: 2 additions & 1 deletion IntrospectTests/AppKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SwiftUI
@available(macOS 10.15.0, *)
enum TestUtils {
enum Constants {
static let timeout: TimeInterval = 2
static let timeout: TimeInterval = 5
}

static func present<ViewType: View>(view: ViewType) {
Expand All @@ -20,6 +20,7 @@ enum TestUtils {
window.setFrameAutosaveName("Main Window")
window.contentView = NSHostingView(rootView: view)
window.makeKeyAndOrderFront(nil)
window.layoutIfNeeded()
}
}

Expand Down
1 change: 1 addition & 0 deletions IntrospectTests/UIKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum TestUtils {
hostingController.beginAppearanceTransition(true, animated: false)
window.rootViewController = hostingController
window.makeKeyAndVisible()
window.layoutIfNeeded()
hostingController.endAppearanceTransition()
}
}
Expand Down
23 changes: 16 additions & 7 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@ default_platform(:ios)
skip_docs

platform :ios do
lane :test do
scan(
lane :test do |options|
puts 'Running on GitHub CI.' if options[:ci] == 'github'
multi_scan(
devices: ["iPhone 8"],
scheme: "Introspect iOS"
scheme: "Introspect iOS",
skip_build: options[:ci] == 'github',
try_count: 3,
quit_simulators: false
)

scan(
multi_scan(
devices: ["Apple TV"],
scheme: "Introspect tvOS"
scheme: "Introspect tvOS",
skip_build: options[:ci] == 'github',
try_count: 3,
quit_simulators: false
)
end
end

platform :mac do
lane :test do
lane :test do |options|
puts 'Running on GitHub CI.' if options[:ci] == 'github'
scan(
scheme: "Introspect macOS"
scheme: "Introspect macOS",
skip_build: options[:ci] == 'github'
)
end
end
5 changes: 5 additions & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-test_center'