fastlane-plugin-stream_actions 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 588bc089b57e2d637ed87e062d4f70b47b9ed434a902331ade91e775b97c251d
4
- data.tar.gz: '09dd367927a51c2976dc9e2bc2a52827b78ff26b9c6e37bacb6bbd66d1ffc23b'
3
+ metadata.gz: f167f7e71ba5f2f1e4c5e7f8f82bed780115104efd56b8cdfb7694bf8e2f2cc9
4
+ data.tar.gz: d3c46876b539bedb30dde0c4c9bae24f06f6f17270dd1d15ba71016d90f15678
5
5
  SHA512:
6
- metadata.gz: d125f60bb7937c1825928b57c77b02eb49fae737636792b252fb257e882817be3b978003ef2d9aea4b4a0a8c7b57c2062b0b1f94a76bb75c103c0cc0b6a3f60a
7
- data.tar.gz: 07e0d6184d4e3b363fbb0f4cabbff98dd681e96a96b89f7184f2b5bf5cd9d4a746a0eba382181c1866aa4443f55e3bf3c4cafa01aef3d0df3c3bf90e4251444a
6
+ metadata.gz: 63a95e3b242b4f75dc39172b46a80f81fabb2ce2f0cf8a22467905670ef23f06b967f4e3f7c2fec242b48f4233870865c9cc0ba75dfe104a86f18f03214da178
7
+ data.tar.gz: d830ff076ec3d1fff8a39c92f15eee970608f1799b14f1db0144af1bcd2e5081c57c1dc1428fcf51c3db605c38202e24f0caa84d3d5bdbee28e1e268d7508958
@@ -155,14 +155,47 @@ module Fastlane
155
155
  #####################################################
156
156
 
157
157
  def self.description
158
- 'Analyzes the impact of changes on PR'
158
+ 'Decides whether a CI check (tests, build, etc.) needs to run for the current pull request state'
159
+ end
160
+
161
+ def self.details
162
+ <<~DETAILS
163
+ Skips CI work that has nothing to verify, without ever skipping work that has not been verified yet.
164
+
165
+ The action inspects which files changed and returns:
166
+ - true -> the caller should run the check
167
+ - false -> the caller can safely skip it (usually via `next unless is_check_required(...)`)
168
+
169
+ How the decision is made:
170
+ 1. If `force_check` is set, or no PR number is available (e.g. a push to a branch), it returns true.
171
+ 2. It collects the changed files. On a `synchronize` event with `github_event_before`/`after`, only
172
+ the files in that single push are considered; otherwise the whole PR diff is used.
173
+ 3. If more than 99 files changed, it returns true (the GitHub CLI cannot reliably list more).
174
+ 4. If any changed file lives under one of `sources`, the check is relevant -> returns true.
175
+ 5. If no changed file touches `sources`:
176
+ - With no `required_checks`, it returns false (nothing relevant changed in this push).
177
+ - With `required_checks`, it confirms the sources were actually verified before skipping. It walks
178
+ the PR commits newest-to-oldest: every commit newer than the last `sources` change shares the
179
+ current source tree, so if all `required_checks` concluded `success` on any of them, the sources
180
+ are proven and it returns false. The walk stops at the commit that changed `sources` (older
181
+ commits carry different sources); if none of them passed, the sources are unverified -> true.
182
+ If `sources` were never changed anywhere in the PR, there is nothing to test -> false.
183
+
184
+ This is what prevents a docs-only follow-up commit (e.g. editing CHANGELOG.md) from skipping tests
185
+ when the underlying source changes never passed CI.
186
+ DETAILS
187
+ end
188
+
189
+ def self.return_value
190
+ 'Boolean. true when the check should run, false when it can be safely skipped for the current PR state.'
159
191
  end
160
192
 
161
193
  def self.available_options
162
194
  [
163
195
  FastlaneCore::ConfigItem.new(
164
196
  key: :sources,
165
- description: 'Array of paths to scan',
197
+ description: 'Paths the check cares about. If a changed file path starts with any of these, the ' \
198
+ 'check is relevant and must run. Non-empty array of path prefixes, e.g. ["Sources", "Tests"]',
166
199
  is_string: false,
167
200
  verify_block: proc do |array|
168
201
  UI.user_error!("Sources have to be specified") unless array.kind_of?(Array) && array.size.positive?
@@ -171,53 +204,76 @@ module Fastlane
171
204
  FastlaneCore::ConfigItem.new(
172
205
  env_name: 'GITHUB_PR_NUM',
173
206
  key: :github_pr_num,
174
- description: 'GitHub PR number',
207
+ description: 'Pull request number to analyze. When empty or nil (e.g. not running for a PR), the ' \
208
+ 'action always returns true',
175
209
  optional: true
176
210
  ),
177
211
  FastlaneCore::ConfigItem.new(
178
212
  key: :required_checks,
179
- description: 'Names of GitHub check runs that must have concluded as success on the last commit ' \
180
- 'that changed :sources for the check to be skipped when the current push does not ' \
181
- 'touch :sources. When empty, the check is skipped as soon as the current push does ' \
182
- 'not touch :sources',
213
+ description: 'GitHub check-run names (exactly as shown on the PR, e.g. "Test (iOS 17)") that must ' \
214
+ 'have concluded as success to prove the current sources were already verified. Only ' \
215
+ 'consulted when the current push does not touch :sources: the check is skipped only if ' \
216
+ 'all of these passed on a commit that has the current source tree. When empty, a push ' \
217
+ 'that does not touch :sources is skipped immediately, without any verification',
183
218
  is_string: false,
184
219
  optional: true,
185
220
  default_value: []
186
221
  ),
187
222
  FastlaneCore::ConfigItem.new(
188
223
  key: :force_check,
189
- description: 'GitHub PR number',
224
+ description: 'When truthy, bypass all analysis and always return true (force the check to run)',
190
225
  optional: true,
191
226
  is_string: false
192
227
  ),
193
228
  FastlaneCore::ConfigItem.new(
194
229
  env_name: 'GITHUB_EVENT_ACTION',
195
230
  key: :github_event_action,
196
- description: 'pull_request action: e.g. opened, synchronize. When synchronize and before/after ' \
197
- 'are set, only files in that push are considered',
231
+ description: 'The pull_request event action, e.g. "opened" or "synchronize". When "synchronize" and ' \
232
+ 'github_event_before/after are set, only the files in that push are considered; ' \
233
+ 'otherwise the full PR diff is used',
198
234
  optional: true
199
235
  ),
200
236
  FastlaneCore::ConfigItem.new(
201
237
  env_name: 'GITHUB_EVENT_BEFORE',
202
238
  key: :github_event_before,
203
- description: 'github.event.before (head ref before the push) for pull_request',
239
+ description: 'github.event.before: the branch head SHA before the push. Combined with ' \
240
+ 'github_event_after to scope the diff to a single push on synchronize',
204
241
  optional: true
205
242
  ),
206
243
  FastlaneCore::ConfigItem.new(
207
244
  env_name: 'GITHUB_EVENT_AFTER',
208
245
  key: :github_event_after,
209
- description: 'github.event.after (head ref after the push) for pull_request',
246
+ description: 'github.event.after: the branch head SHA after the push. Combined with ' \
247
+ 'github_event_before to scope the diff to a single push on synchronize',
210
248
  optional: true
211
249
  ),
212
250
  FastlaneCore::ConfigItem.new(
213
251
  env_name: 'GITHUB_REPOSITORY',
214
252
  key: :github_repository,
215
- description: 'owner/repo; required for push-scoped file list (defaults to GITHUB_REPOSITORY in CI)',
253
+ description: 'Repository in "owner/repo" form. Needed to scope the diff to a push and to look up ' \
254
+ 'commit history and check runs. Defaults to the GITHUB_REPOSITORY env var set in CI',
216
255
  optional: true
217
256
  )
218
257
  ]
219
258
  end
220
259
 
260
+ def self.example_code
261
+ [
262
+ 'next unless is_check_required(sources: ["Sources", "Tests"])',
263
+ 'unless is_check_required(
264
+ sources: ["Sources"],
265
+ github_pr_num: ENV["GITHUB_PR_NUM"],
266
+ required_checks: ["Test (iOS 17)", "Build"]
267
+ )
268
+ next
269
+ end'
270
+ ]
271
+ end
272
+
273
+ def self.category
274
+ :testing
275
+ end
276
+
221
277
  def self.is_supported?(platform)
222
278
  true
223
279
  end
@@ -25,7 +25,11 @@ module Fastlane
25
25
  end
26
26
 
27
27
  sim.reset if sim && params[:reset]
28
- sh("xcrun simctl bootstatus #{udid} -b")
28
+ if params[:wait_for_boot]
29
+ sh("xcrun simctl bootstatus #{udid} -b")
30
+ else
31
+ sh("xcrun simctl boot #{udid} || true")
32
+ end
29
33
  UI.success("Simulator #{device_name} #{ios_version_with_brackets} is ready")
30
34
  udid
31
35
  end
@@ -50,6 +54,13 @@ module Fastlane
50
54
  description: 'Reset simulator contents',
51
55
  optional: true,
52
56
  is_string: false
57
+ ),
58
+ FastlaneCore::ConfigItem.new(
59
+ key: :wait_for_boot,
60
+ description: 'Wait for simulator to finish booting',
61
+ optional: true,
62
+ default_value: true,
63
+ is_string: false
53
64
  )
54
65
  ]
55
66
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.4.5'
3
+ VERSION = '0.4.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-30 00:00:00.000000000 Z
11
+ date: 2026-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xctest_list