sersoft-gmbh / xcodebuild-action Goto Github PK
View Code? Open in Web Editor NEWA GitHub action that runs xcodebuild
License: Apache License 2.0
A GitHub action that runs xcodebuild
License: Apache License 2.0
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!
running Mac OS application tests fails to code sign. When we run xcodebuild as a shell command it succeeds.
▸ Signing ~/DerivedData/App-.../Build/Products/Debug/App.app/Contents/Frameworks/MyFramework.framework
34
▸ Running script '[CP] Embed Pods Frameworks'
35
** TEST FAILED **
36
37
38
The following build commands failed:
39
CodeSign ../DerivedData/App-.../Build/Products/Debug/App.app
40
(1 failure)
41
Error: Xcodebuild action failed (65)!
I would like to be able to run my Test Plans instead of the traditional tests. Is it possible to achieve this with this GitHub actions repository?
Thank you for the great GitHub action!
We use it everyday on GitHub and self hosted runners.
Sometime we have to reproduce the failure locally and it's hard to construct exact command that caused the failure.
It would be great if action logs xcodebuild
command before executing it. This way when build has failed on CI, we can copy paste it locally in attempt to reproduce the failure.
We used to do that when we simply run xcodebuild
as a shell command from our workflow. Now we use action it takes time to convert action parameters to xcodebuild
parameters.
Thank you for useful action!
Would it be possible to allow color output in logs?
xcpretty --color
Would be great to have support for xcodebuild -archivePath
Inspiration can be found in https://github.com/sergeysova/xcodebuild-action
Hi,
I found that xcpretty does not really pick up the output from Xcode test plans running in parallel but xcbeautify works fine. It would be great to add an option to use xcbeautify
. I think it works the same way as xcpretty, i.e the output is piped through.
I have Xcode project with automatic manage signing. And trying to build it using GitHub Actions,
# Whether provisioning updates are allowed. See also `xcodebuild`'s `-allowProvisioningUpdates`.
allow-provisioning-updates: true
# Whether provisioning device registrations are allowed. See also `xcodebuild`'s `-allowProvisioningDeviceRegistration`.
allow-provisioning-device-registration: true
but got error
Hello, I'm currently working on a job to export a game engine project "Godot" to iOS, the job will export (working), and test in xcode (not working).
I've been researching a little and could do this with xcodebuild, but I'm not getting it, until I found this Action from GitHub, but I found no part to add framework in the documentation, its possible with this action?
I want to add frameworks, add linker flags and add keys on ".plist" file.
If this action can not do this, thats ok, but if possible tell me how to do this directly using the command xcodebuild, thanks
As a dev-ops engineer, I would like to be able to specify a list of tests to skip or only test.
Here is an example yml config that will fail:
name: Swift Integration Tests
on:
pull_request:
branches:
push:
branches:
- master
jobs:
test:
name: Tests
runs-on: macos-latest
strategy:
matrix:
destination: ['platform=iOS Simulator,OS=14.4,name=iPhone 12 Pro Max']
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Build and Test
uses: sersoft-gmbh/xcodebuild-action@v1
with:
project: OurSDK.xcodeproj
scheme: OurSDKTests
destination: ${{ matrix.destination }}
action: test
skip-testing:
- SDK/SDKFilterTests/testBlurFilter
- SDK/SDKLocationTests/testRealLocation
- SDK/SDKMiscTests/
This will fail due to skip-testing not expecting a sequence. This will pass:
...
skip-testing: 'SDK/SDKFilterTests/testBlurFilter'
But now how can I define other tests to skip, given that duplicate keys with different values in YAML will simply overwrite the first key?
I have the following build line:
xcodebuild -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -project 'Split.xcodeproj' -scheme 'Split' -destination 'platform=iOS Simulator,OS=13.2.2,name=iPhone 11 Pro Max' -derivedDataPath "${GITHUB_WORKSPACE}" build | xcpretty
Which I converted to:
- name: Build with action
uses: sersoft-gmbh/xcodebuild-action@v1
with:
project: Split.xcodeproj
scheme: Split
destination: 'platform=iOS Simulator,OS=13.2.2,name=iPhone 11 Pro Max'
sdk: 'iphonesimulator'
build-settings: ONLY_ACTIVE_ARCH=NO
derived-data-path: "${GITHUB_WORKSPACE}"
use-xcpretty: true
action: build
The single line version works ok, but for the action one I'm getting some clang errors:
▸ Compiling Split_vers.c
❌ clang: error: no such file or directory: '/Users/runner/work/ios-client/ios-client//Users/runner/work/ios-client/ios-client/ModuleCache.noindex/Session.modulevalidation'
▸ Compiling JFRandom.m
❌ clang: error: no such file or directory: '/Users/runner/work/ios-client/ios-client//Users/runner/work/ios-client/ios-client/ModuleCache.noindex/Session.modulevalidation'
▸ Compiling JFBCrypt.m
❌ clang: error: no such file or directory: '/Users/runner/work/ios-client/ios-client//Users/runner/work/ios-client/ios-client/ModuleCache.noindex/Session.modulevalidation'
▸ Compiling Split_vers.c
** BUILD FAILED **
The following build commands failed:
CompileC /Users/runner/work/ios-client/ios-client/Users/runner/work/ios-client/ios-client/Build/Intermediates.noindex/Split.build/Debug-iphonesimulator/Split.build/Objects-normal/x86_64/Split_vers.o /Users/runner/work/ios-client/ios-client/Users/runner/work/ios-client/ios-client/Build/Intermediates.noindex/Split.build/Debug-iphonesimulator/Split.build/DerivedSources/Split_vers.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/runner/work/ios-client/ios-client/Users/runner/work/ios-client/ios-client/Build/Intermediates.noindex/Split.build/Debug-iphonesimulator/Split.build/Objects-normal/x86_64/JFRandom.o /Users/runner/work/ios-client/ios-client/Split/Common/Utils/JFBCrypt/JFRandom.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/runner/work/ios-client/ios-client/Users/runner/work/ios-client/ios-client/Build/Intermediates.noindex/Split.build/Debug-iphonesimulator/Split.build/Objects-normal/x86_64/JFBCrypt.o /Users/runner/work/ios-client/ios-client/Split/Common/Utils/JFBCrypt/JFBCrypt.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
Error: Xcodebuild action failed (65)!
any idea? are my parameters wrong?
I have an initial step for selecting xcode:
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 11.2
Composing command
output is very useful for debugging failing tests locally.Usually we copy it from log to paste to terminal locally.
Unfortunately it fails due to double quotes:
https://github.com/Lucra-Sports/ExploratoryTests/runs/6053712764?check_suite_focus=true#step:5:13
shows:
xcodebuild -project Experiments.xcodeproj -scheme Experiments -destination platform=iOS Simulator,name=iPhone 12 -resultBundlePath /Users/runner/work/ExploratoryTests/ExploratoryTests/test-results/all-tests test | xcpretty --color
while actual command should be:
xcodebuild -project Experiments.xcodeproj -scheme Experiments -destination "platform=iOS Simulator,name=iPhone 12" -resultBundlePath /Users/runner/work/ExploratoryTests/ExploratoryTests/test-results/all-tests test | xcpretty --color
where double quotes should be around long arguments: "platform=iOS Simulator,name=iPhone 12"
Would also be possible to path for the resultBundlePath
as it is in the workflow file?
For example:
instead of: /Users/runner/work/ExploratoryTests/ExploratoryTests/test-results/all-tests
to show: test-results/all-tests
as it is in the workflow file: https://github.com/Lucra-Sports/ExploratoryTests/actions/runs/2179851359/workflow#L30
This allows to run same command locally, as absolute path is different.
Thank you!
Thank you for the great action!
Would you please help how to specify iOS simulator correctly?
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest-stable'
- run: xcrun xctrace list devices
- name: Checkout
uses: actions/checkout@v3
- name: Test
uses: sersoft-gmbh/xcodebuild-action@v1
with:
project: Experiments.xcodeproj
scheme: Experiments
sdk: iphonesimulator
result-bundle-path: test-results/all-tests
destination: 'platform=iOS Simulator,name=iPhone 12'
getting:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[19](https://github.com/Lucra-Sports/ExploratoryTests/runs/6036429190?check_suite_focus=true#step:5:19)
{ platform:iOS Simulator, OS:latest, name:iPhone 12 }
[20](https://github.com/Lucra-Sports/ExploratoryTests/runs/6036429190?check_suite_focus=true#step:5:20)
[21](https://github.com/Lucra-Sports/ExploratoryTests/runs/6036429190?check_suite_focus=true#step:5:21)
Ineligible destinations for the "Experiments" scheme:
[22](https://github.com/Lucra-Sports/ExploratoryTests/runs/6036429190?check_suite_focus=true#step:5:22)
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
[23](https://github.com/Lucra-Sports/ExploratoryTests/runs/6036429190?check_suite_focus=true#step:5:23)
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
[24](https://github.com/Lucra-Sports/ExploratoryTests/runs/6036429190?check_suite_focus=true#step:5:24)
Error: Xcodebuild action failed (70)!
https://github.com/Lucra-Sports/ExploratoryTests/runs/6036429190?check_suite_focus=true
getting this error when building my project
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 11 }
Ineligible destinations for the "Ghosting Connector" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
my project has cocoa pods dependencies that need to be built before it can run, how can I include those ?
Hi!
Trying to build and ZIP the XCUI test suite, but no matter which approach I take, I have issues retrieving the file.
I was only ever able to get the file usually located in DerivedData/**/Build/Products/Debug-iphonesimulator/
never the one which I actually need DerivedData/**/Build/Products/Debug-iphoneos/
In other words, my build target needs to be for generic/device.
Is there a setting I am missing where a runner would be built for a device?
Thank you!
## BUILD AND SAVE XCTEST RUNNER ====================================================
- name: Build XCUITest via action
uses: sersoft-gmbh/[email protected]
with:
workspace: TARGET.xcworkspace
scheme: TARGET-UITests
destination: generic/platform=iOS
action: build-for-testing
cloned-source-packages-path: "SourcePackages"
allow-provisioning-updates: true
- name: Save XCUI
uses: actions/upload-artifact@v3
with:
name: TARGET-UITests-Runner.app
path: TARGET-UITests-Runner.app
- name: Zip Runner
uses: vimtor/action-zip@v1
with:
files: TARGET-UITests-Runner.app
dest: TARGET-UITests-Runner.zip
I've set up a simple workflow, and have played around with a couple different path settings, but I get this same error every single time.
xcodebuild: error: '[app_name].xcworkspace' does not exist.
name: TestAction
on:
push:
pull_request:
branches: [ master, dev ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Xcodebuild Action
uses: sersoft-gmbh/[email protected]
with:
# The path to the xcworkspace to build. Mutually exclusive with `project`.
project: [app_name].xcworkspace
# The scheme to build. Required when using a workspace.
scheme: [scheme]
File structure from root of repository:
.github.com/workflows/testAction.yml
[app_name]/[app_name].xcworkspace
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.