Skip to content

Instantly share code, notes, and snippets.

@fedejordan
fedejordan / publish_code_coverage.rb
Created September 7, 2021 03:33
Blog14 - Custom action with commit SHA
module Fastlane
module Actions
class PublishCodeCoverageAction < Action
COVERAGE_FILE_PATH = 'fastlane/code_coverage/index.html'
def self.run(params)
UI.message "Generating Slather report"
Actions::SlatherAction.run(
@fedejordan
fedejordan / publish_code_coverage.rb
Created August 23, 2021 07:32
Blog14 - Custom action with getting code coverage number
module Fastlane
module Actions
class PublishCodeCoverageAction < Action
COVERAGE_FILE_PATH = 'fastlane/code_coverage/index.html'
def self.run(params)
UI.message "Generating Slather report"
Actions::SlatherAction.run(
@fedejordan
fedejordan / publish_code_coverage.rb
Created August 23, 2021 07:20
Blog14 - Custom action with Slather
module Fastlane
module Actions
class PublishCodeCoverageAction < Action
def self.run(params)
UI.message "Generating Slather report"
Actions::SlatherAction.run(
scheme: 'CodeCoverageStatusCheck',
proj: 'CodeCoverageStatusCheck.xcodeproj',
output_directory: "fastlane/code_coverage",
@fedejordan
fedejordan / Gemfile
Created August 23, 2021 07:02
Blog14 - Slather gem
source "https://rubygems.org"
gem "fastlane"
gem "slather"
@fedejordan
fedejordan / Fastfile
Created August 23, 2021 06:45
Blog14 - Fastlfile with scan
default_platform(:ios)
platform :ios do
desc "Run tasks when submitting a pull request"
lane :tasks_for_pull_request do
scan
publish_code_coverage
end
end
@fedejordan
fedejordan / Fastfile
Created August 23, 2021 06:39
Blog14 - Fastfile with publish_code_coverage call
default_platform(:ios)
platform :ios do
desc "Run tasks when submitting a pull request"
lane :tasks_for_pull_request do
publish_code_coverage
end
end
@fedejordan
fedejordan / publish_code_coverage.rb
Created August 23, 2021 06:35
Blog14 - Modified custom action
module Fastlane
module Actions
class PublishCodeCoverageAction < Action
def self.run(params)
UI.message "Generating Slather report"
UI.message "Obtaining coverage number"
UI.message "Getting commit SHA"
UI.message "Publishing coverage on Github"
end
@fedejordan
fedejordan / publish_code_coverage.rb
Created August 23, 2021 06:30
Blog14 - Empty custom action
module Fastlane
module Actions
module SharedValues
PUBLISH_CODE_COVERAGE_CUSTOM_VALUE = :PUBLISH_CODE_COVERAGE_CUSTOM_VALUE
end
class PublishCodeCoverageAction < Action
def self.run(params)
# fastlane will take care of reading in the parameter and fetching the environment variable:
UI.message "Parameter API Token: #{params[:api_token]}"
@fedejordan
fedejordan / Fastfile
Last active August 23, 2021 06:22
Blog14 - Hello world on Fastfile
default_platform(:ios)
platform :ios do
desc "Run tasks when submitting a pull request"
lane :tasks_for_pull_request do
UI.message "Hello Fastlane world!"
end
end
@fedejordan
fedejordan / Fastfile
Created August 23, 2021 06:16
Blog14 - Empty Fastfile
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins