I am new at using Github Actions,Have written below ios.yml file and getting error like
Error: Process completed with exit code 70. on execution.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build and Test default scheme using any available iPhone simulator
runs-on: macos
steps:
- name: Checkout
uses: actions/checkout#v2
- name: Set Default Scheme
run: sudo xcodebuild clean build test -workspace testing.xcworkspace -scheme "testing" -sdk iphonesimulator -destination "platform=iOS Simulator,OS=15.4,name=iphone 8" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO```
Try removing CODE_SIGN_IDENTITY="" and test
Related
I'm trying to use Github Actions to compile a project, but I always get the error cannot find input file: Makefile.in. I don't get the error when compiling locally on my computer.
Here is my code:
name: C/C++ CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout#v3
- run: chmod +rwx ./configure
- name: Configure
run: ./configure CC="gcc"
- name: make
run: make
It seems that Github is not able to create new files during a workflow run. I've also noticed that if I try to create a folder (eg. mkdir build), the folder isn't created (running cd build on the folder fails). Does anyone know how to work around this issue?
I have swift package for iOS apps (it needs UIKit to run). I wan't to build this package using Github action this is how my workflow looks like
name: Swift
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout#v2
- uses: YOCKOW/Action-setup-swift#master
with:
swift-version: '5.3'
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
When I run this build I got error: no such module 'UIKit'.
So I have 2 options:
make my package UIKit independent (actually don't know how)
configure build to run on iOS specifically
What should I do?
We're using xcodebuild instead of swift build to do platform specific CI from GitHub Actions. See specific example at https://github.com/firebase/firebase-ios-sdk/blob/master/.github/workflows/spm.yml and https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/build.sh#L540
The simplest approach as of 2022 is to use xcodebuild like stated above.
Condensed to the basics, the script can be as simple as this:
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Build and Test
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout#v3
# Sanity check to make sure we use a valid device in the next step
- name: List available devices
run: xcrun simctl list devicetypes
#generic/platform=iOS is sufficient for just building, - but need to specify concrete destination for tests
- name: Build and run tests
run: xcodebuild test -scheme YourSchemeNameHere -destination 'platform=iOS Simulator,name=iPhone 13 Pro' #or any other name from the list of sim devices
This is enough to build the project and run tests on it.
In some cases you may need to install a later version of Swift than what's available by default on Github Actions, - you can use a third party step for that and use xcode-select.
I have a repository with some subdirectories. One of the subdirectory is called gradle-specific which is the gradle project. I want to run ./gradlew clean build using github actions. My yaml file looks as follows:
name: Java CI with Gradle
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./gradle-specific
steps:
- uses: actions/checkout#v3
- name: Set up JDK 16
uses: actions/setup-java#v3
with:
java-version: '16'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action#67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: clean build
but error logs indicate that the build is happening in the root folder itself:
Error: Error: Cannot locate a Gradle wrapper properties file at '/home/runner/work/service-commons/service-commons/gradle/wrapper/gradle-wrapper.properties'. Specify 'gradle-version' or 'gradle-executable' for projects without Gradle wrapper configured.
where service-commons is my repository name
I tried specifying the working directory without relative path, with relative path, specifying globally. I am following https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun to configure the same
I am new to Github actions and I was trying to make an action to attempt a build and see if the build passes or fails an Xcode iOS build but I keep getting the error
line 1: cd: Swift/: No such file or directory
6
Error: Process completed with exit code 1.
Any help would be appreciated!
Code:
name: Xcode build iOS 14
on: [push, pull_request]
jobs:
build:
runs-on: macos-11
steps:
- uses: actions/checkout#v2
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_13.3.app
- name: Xcode version
run: /usr/bin/xcodebuild -version
- name: Xcode build
run: |
cd Swift/
xcodebuild clean build -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 12,OS=14.4'
I would try cd Swift instead of cd Swift/ , if you have Swift folder in your project.
I am using another Git Repo as library, which uses a different .net Version and has missing Permissions to be build on Action.
How do i exclude this/all sub modules from being built ?
Error Codes being Produced:
error MSB3191: Unable to create directory "obj/Debug/". Access to the path '/home/runner/work/Repo/Project/Submodule/Folder/obj/Debug/' is denied.
error MSB3644: The reference assemblies for .NETFramework,Version=v2.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application...
Workflow File (dotnet.yml)
name: .NET
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- uses: textbook/git-checkout-submodule-action#master
- name: Setup .NET
uses: actions/setup-dotnet#v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal