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

Using iOS platform (it does work, not only macOS) and issues with specifying spm-package #94

Closed
JeneaVranceanu opened this issue Sep 21, 2022 · 2 comments

Comments

@JeneaVranceanu
Copy link

JeneaVranceanu commented Sep 21, 2022

In README.md it's stated that only macOS destination will work but that appears to be false.
I've specified destination as following and it did work fine:

destination: platform=iOS Simulator,name=iPhone 13

I'm testing an SPM package and one other weird thing is that I had to set spm-package as . in order for the action to work:

spm-package: .

Here are all jobs that run during CI:

jobs:
  spm:
    name: Swift Package Manager
    runs-on: macOS-12
    steps:
      - uses: actions/checkout@v2
      - name: Resolve dependencies
        run: swift package resolve
      - uses: sersoft-gmbh/xcodebuild-action@v2
        with:
          spm-package: .
          scheme: UniversalProfile
          destination: platform=iOS Simulator,name=iPhone 13
          action: test

P.S. Thanks for this GitHub Action!

@ffried
Copy link
Member

ffried commented Sep 21, 2022

The note in the README is not about the destination input, but about the actions runner (runs-on). Since there's no Xcode (thus no xcodebuild) on Linux or Windows, you can only run this action on a macOS runner.

As for destination, you can run it against any valid Xcode destination. Since this action in the end only builds an xcodebuild invocation, any valid input to xcodebuild's -destination input can also be used as the destination input of this action.

The behavior with spm-package is expected. Specifying this input will turn on SPM-support for this action. The three inputs spm-package, project and workspace are mutually exclusive, but one of them is required. So you need to provide one of them to tell this action, what it should build. In your case it's an SPM package in the current directory.

@ffried ffried closed this as completed Sep 21, 2022
@JeneaVranceanu
Copy link
Author

Oh, my mistake then. For some reason, I thought it could be an outdated README but it didn't cross my mind that it was a note about the runner, not the platform that the project is built for.
Thanks!

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

2 participants