Skip to content

Commit

Permalink
Add emerge PR uploads (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsmartin authored Aug 15, 2023
1 parent e2582dc commit acb433e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,20 @@ namespace :emerge do
filename: 'test.zip'
}
if ENV["PR_NUMBER"] != "" && ENV["PR_NUMBER"] != "false"
# TODO: Enable PR uploads
next
upload_data[:sha] = g.log[0].parents[1].sha
upload_data[:baseSha] = g.log[0].parent.sha
upload_data[:prNumber] = ENV["PR_NUMBER"]
upload_data[:buildType] = 'pull_request'
else
upload_data[:sha] = g.log[0].sha
upload_data[:buildType] = 'master'
end
api_token_header = "X-API-Token: #{ENV['EMERGE_API_TOKEN']}"
api_token = ENV['EMERGE_API_TOKEN']
if api_token.nil? || api_token.empty?
puts "Skipping Emerge upload because API token was not provided."
next
end
api_token_header = "X-API-Token: #{api_token}"
url = "https://api.emergetools.com/upload"
cmd = "curl --fail -s --request POST --url #{url} --header 'Accept: application/json' --header 'Content-Type: application/json' --header '#{api_token_header}' --data '#{upload_data.to_json}'"
upload_json = %x(#{cmd})
Expand Down
1 change: 1 addition & 0 deletions Tests/SnapshotConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ extension SnapshotConfiguration {
"Issues/issue_2066": .precision(0.9),
"LottieFiles/dog_car_ride": .precision(0.95),
"Issues/issue_1800": .precision(0.95),
"Issues/issue_1882": .precision(0.95),
"Issues/issue_1717": .precision(0.95),
"DotLottie/animation_external_image": .precision(0.95),
"DotLottie/animation_inline_image": .precision(0.95),
Expand Down

0 comments on commit acb433e

Please sign in to comment.