Skip to content
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
47 changes: 42 additions & 5 deletions bitrise.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,56 @@
format_version: 5
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

app:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-samples/sample-apps-ios-simple-objc-with-uitest.git

workflows:
test:
before_run:
- go-tests
- audit-this-step
- go-tests
steps:
- file-downloader@0.9.1:
- script:
inputs:
- source: "$BITRISEIO_TEST_XCTESTRUN_SAMPLE_URL"
- destination: "/tmp/ios_UI_test_sample.zip"
- content: |-
#!/bin/bash
set -ex
rm -rf "$BITRISE_SOURCE_DIR/_tmp"
mkdir -p "$BITRISE_SOURCE_DIR/_tmp"
- change-workdir:
title: Switch working dir to _tmp dir
run_if: true
inputs:
- path: "$BITRISE_SOURCE_DIR/_tmp"
- is_create_path: true
- script:
inputs:
- content: |-
#!/bin/bash
set -ev
git clone "$SAMPLE_APP_URL" .
- certificate-and-profile-installer:
- xcode-build-for-test:
inputs:
- project_path: ./ios-simple-objc/ios-simple-objc.xcodeproj
- scheme: ios-simple-objc
- output_tool: xcodebuild
- path::./:
inputs:
- zip_path: "/tmp/ios_UI_test_sample.zip"
- download_test_results: "true"
- script:
title: Output check
inputs:
- content: |-
#!/bin/bash
set -e
if [[ -z "$VDTESTING_DOWNLOADED_FILES_DIR" ]] ; then
echo "VDTESTING_DOWNLOADED_FILES_DIR should not be empty"
exit 1
else
echo "VDTESTING_DOWNLOADED_FILES_DIR: $VDTESTING_DOWNLOADED_FILES_DIR"
fi

go-tests:
steps:
Expand Down
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,15 @@ func main() {
}

func downloadFile(url string, localPath string) error {
// on HFS file system the max file name length: 255 UTF-16 encoding units
base := filepath.Base(localPath)
if len(base) > 255 {
log.Warnf("too long filename: %s", base)
base = base[len(base)-255:]
log.Warnf("trimming to: %s", base)
localPath = filepath.Join(filepath.Dir(localPath), base)
}

out, err := os.Create(localPath)
if err != nil {
return fmt.Errorf("Failed to open the local cache file for write: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ toolkit:
package_name: github.com/bitrise-steplib/steps-virtual-device-testing-for-ios

inputs:
- zip_path:
- zip_path: $BITRISE_TEST_BUNDLE_ZIP_PATH
opts:
title: "Zip path"
summary: |
Expand Down