Skip to content
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

Support multiple lines command #79

Closed
hongbo-miao opened this issue Dec 31, 2022 · 6 comments
Closed

Support multiple lines command #79

hongbo-miao opened this issue Dec 31, 2022 · 6 comments

Comments

@hongbo-miao
Copy link
Contributor

hongbo-miao commented Dec 31, 2022

The original run supports multiple lines such as

        run: |
          xcodebuild build-for-testing \
            -project HMMobile.xcodeproj \
            -scheme HMMobile \
            -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=16.1"

However, for

      - uses: wandalen/wretry.action@v1.0.36
        with:
          command: |
            xcodebuild test-without-building \
              -project HMMobile.xcodeproj \
              -scheme HMMobile \
              -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=16.1"
          attempt_limit: 3
          attempt_delay: 2000

It will only run whatever in first line which is xcodebuild test-without-building \

Here is the GitHub Action log:

Command line invocation:
    /Applications/Xcode_14.1.app/Contents/Developer/usr/bin/xcodebuild test-without-building

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

2022-12-31 12:43:39.234 xcodebuild[3246:15150] Writing error result bundle to /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/ResultBundle_2022-31-12_12-43-0039.xcresult
xcodebuild: error: The test action requires that the name of a scheme in the project is provided using the "-scheme" option. The "-list" option can be used to find the names of the schemes in the project.
Command line invocation:
    /Applications/Xcode_14.1.app/Contents/Developer/usr/bin/xcodebuild test-without-building

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

2022-12-31 12:43:44.530 xcodebuild[3417:15606] Writing error result bundle to /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/ResultBundle_2022-31-12_12-43-0044.xcresult
xcodebuild: error: The test action requires that the name of a scheme in the project is provided using the "-scheme" option. The "-list" option can be used to find the names of the schemes in the project.
Command line invocation:
    /Applications/Xcode_14.1.app/Contents/Developer/usr/bin/xcodebuild test-without-building

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

2022-12-31 12:43:49.909 xcodebuild[3453:15777] Writing error result bundle to /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/ResultBundle_2022-31-12_12-43-0049.xcresult
xcodebuild: error: The test action requires that the name of a scheme in the project is provided using the "-scheme" option. The "-list" option can be used to find the names of the schemes in the project.
Error: Process returned exit code 65
Launched as "xcodebuild test-without-building \"
Launched at "/Users/runner/work/hongbomiao.com/hongbomiao.com/mobile-ios"
Attempts exhausted, made 3 attempts :
Attempt #1 started at : 12:43:35 GMT+0000 (Coordinated Universal Time)
Attempt #2 started at : 12:43:42 GMT+0000 (Coordinated Universal Time)
Attempt #3 started at : 12:43:47 GMT+0000 (Coordinated Universal Time)

It works after I change to

        uses: wandalen/wretry.action@v1.0.36
        with:
          command: |
            xcodebuild test-without-building -project HMMobile.xcodeproj -scheme HMMobile -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=16.1"
          attempt_limit: 3
          attempt_delay: 2000

It would be nice to have support for multiple lines command, thanks! 😃

@dmvict
Copy link
Collaborator

dmvict commented Jan 3, 2023

Hello, @hongbo-miao

Yes, you're right. It's a good feature to can execute multiple-line commands.
I don't know when I will have time to solve the issue.

For now, you can use single-line commands.

I will notify you when I will solve the issue.

@kbolino
Copy link

kbolino commented Mar 1, 2023

I'm running into what I believe is a related issue. The docker/build-push-action requires several of its arguments to be passed as "List type[, which] is a newline-delimited string". This applies to the with argument rather than the command argument, so it may be a distinct issue.

However, while the command can usually be worked around by squashing newlines, I cannot think of any workaround for this case, since newlines are required. I've tried several different things, including various combinations of fromJSON/toJSON functions, and the various line continuation methods in YAML, to no avail.

@dmvict
Copy link
Collaborator

dmvict commented Mar 2, 2023

Hello, @kbolino

Your issue relates to #64.
Please, try to use indentations as in the example.

@dmvict
Copy link
Collaborator

dmvict commented Jun 21, 2023

Hello, @hongbo-miao
This PR #105 solves the issue.
I will notify you about the published version.

@dmvict
Copy link
Collaborator

dmvict commented Jun 22, 2023

Hello, @hongbo-miao

Please try new version v1.2.0. Does it solve the issue?
If yes, close the issue, please.

@hongbo-miao
Copy link
Contributor Author

hongbo-miao commented Jun 27, 2023

Hi @dmvict I just tested at hongbo-miao/hongbomiao.com#9392, it works well. Thank you so much! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants