Running pod install in GitHub Actions causes an error
ArtakYepremyan opened this issue · comments
ArtakYepremyan commented
What did you do?
Run pod install
in yaml file
What did you expect to happen?
Install all pod dependencies correctly.
What happened instead?
NoMethodError - undefined method `gsub' for nil:NilClass
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-core-1.15.2/lib/cocoapods-core/source/manager.rb:436:in `block in name_for_url'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-core-1.15.2/lib/cocoapods-core/source/manager.rb:459:in `name_for_url'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/sources_manager.rb:22:in `find_or_create_source_with_url'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:179:in `block in sources'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:178:in `map'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:178:in `sources'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:144:in `update_repositories'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:240:in `block in resolve_dependencies'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:239:in `resolve_dependencies'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:162:in `install!'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/lib/ruby/gems/3.0.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
/opt/homebrew/lib/ruby/gems/3.0.0/bin/pod:25:in `load'
/opt/homebrew/lib/ruby/gems/3.0.0/bin/pod:25:in `<main>'
CocoaPods Environment
ℹ Please replace these two lines with the output of pod env
.
It's pod env from my computer
Stack
CocoaPods : 1.15.2
Ruby : ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]
RubyGems : 3.0.3.1
Host : macOS 14.1 (23B74)
Xcode : 15.2 (15C500b)
Git : git version 2.39.3 (Apple Git-145)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : 6over6pods-glasseson-pods-specs-production - git - git@github.com:6over6pods/glasseson-pods-specs-production.git @ dc098b62bb9472d5ab0943a91199e07c68a30b44
cocoapods-cdn - CDN - https://cocoapods-cdn.netlify.app/
trunk - CDN - https://cdn.cocoapods.org/
Installation Source
Executable Path: /usr/local/bin/pod
Plugins
cocoapods-deintegrate : 1.0.5
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.1
cocoapods-trunk : 1.6.0
cocoapods-try : 1.2.0
Podfile
source 'ArtakYepremyan:***@github.com:6over6pods/glasseson-pods-specs-production.git'
source 'https://cocoapods-cdn.netlify.app/'
source 'https://cdn.cocoapods.org/'
# ignore all warnings from all pods
inhibit_all_warnings!
platform :ios, '16.0'
use_frameworks!
target 'GlassesUSA' do
pod 'GlassesOn', '5.43.10'
inherit! :search_paths
abstract_target 'Tests' do
target "GlassesUSATests"
pod 'Quick'
pod 'Nimble'
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "16.0"
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
installer.pods_project.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS'] = 'armv7'
end
installer.aggregate_targets.each do |target|
target.xcconfigs.each do |config_name, config_file|
puts "Removing 'EXCLUDED_ARCHS' from #{target.name}"
config_file.attributes.delete 'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
xcconfig_path = target.xcconfig_path(config_name)
config_file.save_as(xcconfig_path)
end
end
end
Project that demonstrates the issue
My project contains private pod that can't be installed without GitHub authentication, so I added my Account login and access token in source "source 'ArtakYepremyan:***@github.com:6over6pods/glasseson-pods-specs-production.git'". But while running GitHub workflow I am getting error described above.
here is my yaml file
name: CI - Test GlassesUSA on iOS 17.2
on: [pull_request]
jobs:
run_tests:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Restart Simulator
run: xcrun simctl shutdown booted
- name: Select Xcode
run:
cd GlassesUSA &&
sudo xcode-select -switch /Applications/Xcode_15.2.app && /usr/bin/xcodebuild -version
- name: Install Dependencies
run:
cd GlassesUSA &&
pod install --repo-update
shell: bash
- name: Run tests
run:
cd GlassesUSA &&
xcodebuild test -scheme GlassesUSA -workspace GlassesUSA.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.2' | xcpretty && exit ${PIPESTATUS[0]}