allure-report-publisher 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d33ea0e4d124c07ae275376e075ab14d3bcfedc7b5d71fdd23b78882e436c09
4
- data.tar.gz: 94d3d70c631aeb9b79aa71fbd18cc920f95cfbe29320c12166d81d1de913cc7a
3
+ metadata.gz: 9231271e7296dcc0921871769aff6442e2a6eb1bb919574b72cb8753be897b4c
4
+ data.tar.gz: ebf30bece57cd457150bc9002b731fce743914f5ab9a11c6457d8e50151b1d2b
5
5
  SHA512:
6
- metadata.gz: e4ba711128088e03fdf2a0f77e9890d33b6eee5e5e1671b613203e2700fdbd715e690ddf4964bcc82762f144560e83333af7e46f22d82c6c96b408f931a33830
7
- data.tar.gz: 2b263c7e7e48d244f30df4efec6358599f31f79f832888a6083b7d3c2dbdaa40458f0216e13142ac9004f20be3efc58c9d2b9f87f57a500da662791ef68151a9
6
+ metadata.gz: 1cd52b5982eb6a5023b7a000a426fefc207aaf9934c84c1364dc51f3f6079058381fd55672c98cc150622702f83300da25c7a369410488cc2b809a1938778d8d
7
+ data.tar.gz: d924adb83f5739a791b16d66bdbe580bb0c6712d7d502f14e115a55ebac621884e14a1a97ac46369be4c1de1eabaecc64288e5d0256bc735cef4594b7e41f35c
data/README.md CHANGED
@@ -47,7 +47,7 @@ Options:
47
47
  --results-glob=VALUE # Allure results files glob. Required: true
48
48
  --bucket=VALUE # Bucket name. Required: true
49
49
  --prefix=VALUE # Optional prefix for report path. Required: false
50
- --update-pr=VALUE # Add report url to PR via comment or description update. Required: false: (comment/description)
50
+ --update-pr=VALUE # Add report url to PR via comment or description update. Required: false: (comment/description/actions)
51
51
  --summary=VALUE # Additionally add summary table to PR comment or description. Required: false: (behaviors/suites/packages/total)
52
52
  --summary-table-type=VALUE # Summary table type. Required: false: (ascii/markdown), default: :ascii
53
53
  --[no-]collapse-summary # Create summary as a collapsable section, default: false
@@ -109,7 +109,7 @@ Following CI providers are supported:
109
109
 
110
110
  It is possible to update pull requests with urls to published reports and execution summary.
111
111
 
112
- - `--update-pr=(comment|description)`: post report urls in pr description or as a comment
112
+ - `--update-pr=(comment|description|actions)`: post report urls in pr description, as a comment or step summary for github actions
113
113
  - `--summary=(behaviors|suites|packages|total)`: add execution summary table
114
114
  - `--summary-table-type=(ascii|markdown)`: use markdown or ascii table formatting
115
115
  - `--[no-]collapse-summary`: add summary in collapsable section
@@ -22,7 +22,7 @@ module Publisher
22
22
  option :update_pr,
23
23
  type: :string,
24
24
  desc: "Add report url to PR via comment or description update. Required: false",
25
- values: %w[comment description]
25
+ values: %w[comment description actions]
26
26
  option :summary,
27
27
  type: :string,
28
28
  desc: "Additionally add summary table to PR comment or description. Required: false",
@@ -77,7 +77,7 @@ module Publisher
77
77
  return unless args[:update_pr] && uploader.pr?
78
78
 
79
79
  log("Adding reports urls")
80
- Spinner.spin("updating", exit_on_error: false) { uploader.add_url_to_pr }
80
+ Spinner.spin("updating", exit_on_error: false) { uploader.add_result_summary }
81
81
  end
82
82
 
83
83
  private
@@ -53,7 +53,7 @@ module Publisher
53
53
  # Add report url to pull request description
54
54
  #
55
55
  # @return [void]
56
- def add_report_url
56
+ def add_result_summary
57
57
  raise("Not a pull request, skipped!") unless pr?
58
58
  return add_comment if comment?
59
59
 
@@ -58,6 +58,8 @@ module Publisher
58
58
  #
59
59
  # @return [void]
60
60
  def update_pr_description
61
+ return File.write(step_summary_file, url_section_builder.comment_body) if actions?
62
+
61
63
  client.update_pull_request(repository, pr_id, body: url_section_builder.updated_pr_description(pr_description))
62
64
  end
63
65
 
@@ -137,6 +139,26 @@ module Publisher
137
139
 
138
140
  "[#{short_sha}](#{server_url}/#{repository}/pull/#{pr_id}/commits/#{sha})"
139
141
  end
142
+
143
+ # Use actions summary for results
144
+ #
145
+ # @return [Boolean]
146
+ def actions?
147
+ update_pr == "actions"
148
+ end
149
+
150
+ # Github actions summary file
151
+ #
152
+ # @return [String]
153
+ def step_summary_file
154
+ @step_summary_file ||= begin
155
+ summary_file = ENV["GITHUB_STEP_SUMMARY"]
156
+ raise("Environment variable GITHUB_STEP_SUMMARY is empty!") unless summary_file
157
+ raise("Step summary file '#{summary_file}' does not exist!") unless File.exist?(summary_file)
158
+
159
+ summary_file
160
+ end
161
+ end
140
162
  end
141
163
  end
142
164
  end
@@ -47,7 +47,7 @@ module Publisher
47
47
  def execute
48
48
  generate_report
49
49
  upload
50
- add_url_to_pr
50
+ add_result_summary
51
51
  end
52
52
 
53
53
  # Generate allure report
@@ -70,10 +70,10 @@ module Publisher
70
70
  # Add allure report url to pull request description
71
71
  #
72
72
  # @return [void]
73
- def add_url_to_pr
73
+ def add_result_summary
74
74
  return unless update_pr && ci_provider
75
75
 
76
- ci_provider.add_report_url
76
+ ci_provider.add_result_summary
77
77
  end
78
78
 
79
79
  # Uploaded report urls
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Publisher
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-report-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-04 00:00:00.000000000 Z
11
+ date: 2022-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 1.93.1
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 1.114.0
22
+ version: 1.115.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 1.93.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 1.114.0
32
+ version: 1.115.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dry-cli
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,6 +50,20 @@ dependencies:
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0.8'
53
+ - !ruby/object:Gem::Dependency
54
+ name: faraday-retry
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.0'
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '1.0'
53
67
  - !ruby/object:Gem::Dependency
54
68
  name: gitlab
55
69
  requirement: !ruby/object:Gem::Requirement
@@ -182,28 +196,28 @@ dependencies:
182
196
  requirements:
183
197
  - - "~>"
184
198
  - !ruby/object:Gem::Version
185
- version: 2.17.0
199
+ version: 2.18.0
186
200
  type: :development
187
201
  prerelease: false
188
202
  version_requirements: !ruby/object:Gem::Requirement
189
203
  requirements:
190
204
  - - "~>"
191
205
  - !ruby/object:Gem::Version
192
- version: 2.17.0
206
+ version: 2.18.0
193
207
  - !ruby/object:Gem::Dependency
194
208
  name: climate_control
195
209
  requirement: !ruby/object:Gem::Requirement
196
210
  requirements:
197
211
  - - "~>"
198
212
  - !ruby/object:Gem::Version
199
- version: 1.0.1
213
+ version: 1.1.0
200
214
  type: :development
201
215
  prerelease: false
202
216
  version_requirements: !ruby/object:Gem::Requirement
203
217
  requirements:
204
218
  - - "~>"
205
219
  - !ruby/object:Gem::Version
206
- version: 1.0.1
220
+ version: 1.1.0
207
221
  - !ruby/object:Gem::Dependency
208
222
  name: pry-byebug
209
223
  requirement: !ruby/object:Gem::Requirement
@@ -336,14 +350,14 @@ dependencies:
336
350
  requirements:
337
351
  - - "~>"
338
352
  - !ruby/object:Gem::Version
339
- version: 0.44.3
353
+ version: 0.45.0
340
354
  type: :development
341
355
  prerelease: false
342
356
  version_requirements: !ruby/object:Gem::Requirement
343
357
  requirements:
344
358
  - - "~>"
345
359
  - !ruby/object:Gem::Version
346
- version: 0.44.3
360
+ version: 0.45.0
347
361
  description: Upload allure reports to different file storage providers
348
362
  email:
349
363
  - andrejs.cunskis@gmail.com