Skip to content

Instantly share code, notes, and snippets.

@fjcaetano fjcaetano/codecov.rb
Last active Jul 10, 2019

Embed
What would you like to do?
Codecov Fastlane action
module Fastlane
module Actions
class CodecovAction < Action
def self.run(params)
cmd = ['curl -s https://codecov.io/bash | bash']
cmd << "-s --" if params.all_keys.inject(false) { |p, k| p or params[k] }
cmd << "-X xcodeplist" if params[:use_xcodeplist]
cmd << "-J '#{params[:project_name]}'" if params[:project_name]
cmd << "-t '#{params[:token]}'" if params[:token]
cmd << "-v" if params[:verbose]
sh cmd.join(" ")
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Upload your coverage files to Codecov"
end
def self.details
"https://codecov.io"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :use_xcodeplist,
env_name: "FL_CODECOV_USE_XCODEPLIST",
description: "[BETA] Upload to Codecov using xcodeplist",
is_string: false,
default_value: false,),
FastlaneCore::ConfigItem.new(key: :project_name,
env_name: "FL_CODECOV_PROJECT_NAME",
description: "Upload to Codecov using a project name",
optional: true),
FastlaneCore::ConfigItem.new(key: :token,
env_name: "FL_CODECOV_TOKEN",
description: "API token for private repos",
optional: true),
FastlaneCore::ConfigItem.new(key: :verbose,
env_name: "FL_CODECOV_VERBOSE",
description: "Verbose logs",
is_string: false,
optional: true,
default_value: false),
]
end
def self.author
"Flávio Caetano (@fjcaetano)"
end
def self.is_supported?(platform)
true
end
end
end
end
@fjcaetano

This comment has been minimized.

Copy link
Owner Author

commented Jul 10, 2019

Installation

  1. Add this gist as a submodule
$ git submodule add https://gist.github.com/04126b3051f6cd6aebe041bb1dfe14e9.git fastlane/actions/codecov
  1. Create a symlink in the action folder
$ ln -s codecov/codecov.rb fastlane/actions/codecov.rb
  1. Check if it is working in your project's root directory:
$ fastlane actions codecov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.