Skip to content

Commit

Permalink
Merge pull request #72 from mkko/fix/ui-tests
Browse files Browse the repository at this point in the history
Export test artifacts
  • Loading branch information
mkko authored Jul 25, 2024
2 parents 6269f47 + a54938c commit df644b6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/xcode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ jobs:
- name: Test UI
run: |
bundle exec fastlane test_ui
- name: Archive UI test results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: artifacts/
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

# Created by https://www.gitignore.io/api/xcode,swift,objective-c,carthage,cocoapods
# GitHub

artifacts

### Carthage ###
# Carthage
Expand Down
23 changes: 22 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,35 @@ platform :ios do

desc "Run UI Tests"
lane :test_ui do
run_tests(
scan(
workspace: "DrawerView.xcworkspace",
scheme: "DrawerViewUI",
ensure_devices_found: true,
include_simulator_logs: false,
output_xctestrun: false,
verbose: true,
open_report: false,
clean: true
)

persist_artifacts
end

end

error do |lane, exception|
persist_artifacts
end

private_lane :persist_artifacts do |options|
xcresult_path = Actions.lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]
if "#{xcresult_path}" != ""
puts "Copying artifacts from #{xcresult_path}..."
copy_artifacts(
target_path: "artifacts",
artifacts: ["#{xcresult_path}"]
)
else
puts "No xcresult_path specified, no artifacts to copy"
end
end

0 comments on commit df644b6

Please sign in to comment.