Skip to content

Commit 43d0a4c

Browse files
[CIS-2245] Implement Fastlane Stream Actions (#230)
1 parent dd56462 commit 43d0a4c

File tree

15 files changed

+373
-672
lines changed

15 files changed

+373
-672
lines changed

.github/workflows/cron-checks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,12 @@ jobs:
7575
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
7676
MATRIX_CONTEXT: ${{ toJson(matrix) }}
7777
if: failure()
78+
79+
automated-code-review:
80+
name: Automated Code Review
81+
runs-on: macos-12
82+
steps:
83+
- uses: actions/[email protected]
84+
- uses: ./.github/actions/bootstrap
85+
- run: bundle exec fastlane rubocop
86+
- run: ./Scripts/run-linter.sh

.github/workflows/smoke-checks.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ jobs:
2727
automated-code-review:
2828
name: Automated Code Review
2929
runs-on: macos-12
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
GITHUB_PR_NUM: ${{ github.event.number }}
3033
if: ${{ github.event_name != 'push' }}
3134
steps:
3235
- uses: actions/[email protected]
3336
- uses: ./.github/actions/bootstrap
3437
- name: Run Danger
3538
run: bundle exec danger
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Run Fastlane Linting
40+
run: bundle exec fastlane rubocop
3841
- name: Run Linting
3942
run: ./Scripts/run-linter.sh
4043

@@ -56,7 +59,7 @@ jobs:
5659
timeout-minutes: 30
5760
env:
5861
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
GITHUB_EVENT: ${{ toJson(github.event) }}
62+
GITHUB_PR_NUM: ${{ github.event.number }}
6063
- name: Get branch name
6164
id: get_branch_name
6265
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
@@ -112,7 +115,7 @@ jobs:
112115
run: bundle exec fastlane test_e2e_mock device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}'
113116
env:
114117
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115-
GITHUB_EVENT: ${{ toJson(github.event) }}
118+
GITHUB_PR_NUM: ${{ github.event.number }}
116119
MATRIX_SIZE: ${{ strategy.job-total }}
117120
- name: Allure TestOps Upload
118121
if: env.LAUNCH_ID != '' && (success() || failure())

Dangerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
skip_danger_check = github.pr_body.include? "#skip_danger"
1+
skip_danger_check = github.pr_body.include?("#skip_danger")
22

33
if skip_danger_check
4-
message("Skipping Danger due to skip_danger tag")
5-
return
4+
message("Skipping Danger due to skip_danger tag")
5+
return
66
end
77

88
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet.
99
if github.pr_json["mergeable_state"] == "draft"
10-
message("Skipping Danger since PR is classed as Draft")
11-
return
10+
message("Skipping Danger since PR is classed as Draft")
11+
return
1212
end
1313

1414
# Warn when there is a big PR.
1515
warn("Big PR") if git.lines_of_code > 500
1616

1717
# Mainly to encourage writing up some reasoning about the PR, rather than just leaving a title.
1818
if github.pr_body.length < 3 && git.lines_of_code > 50
19-
warn("Please provide a summary in the Pull Request description")
19+
warn("Please provide a summary in the Pull Request description")
2020
end
2121

2222
## Let's check if there are any changes in the project folder
@@ -29,18 +29,18 @@ has_app_changes = !git.modified_files.grep(/Sources/).empty?
2929
# warn("Please adds tests!")
3030
# end
3131

32-
has_meta_label = github.pr_labels.any? { |label| label.include? "meta" }
33-
has_demo_label = github.pr_labels.any? { |label| label.include? "demo" }
34-
has_no_changelog_tag = github.pr_body.include? "#no_changelog"
35-
has_skip_changelog_tag = github.pr_body.include? "#skip_changelog"
32+
has_meta_label = github.pr_labels.any? { |label| label.include?("meta") }
33+
has_demo_label = github.pr_labels.any? { |label| label.include?("demo") }
34+
has_no_changelog_tag = github.pr_body.include?("#no_changelog")
35+
has_skip_changelog_tag = github.pr_body.include?("#skip_changelog")
3636

3737
has_changelog_escape = has_meta_label || has_demo_label || has_no_changelog_tag || has_skip_changelog_tag
3838

3939
# Add a CHANGELOG entry for app changes
4040
if !has_changelog_escape && !git.modified_files.include?("CHANGELOG.md") && has_app_changes
41-
message("There seems to be app changes but CHANGELOG wasn't modified.\nPlease include an entry if the PR includes user-facing changes.\nYou can find it at [CHANGELOG.md](https://github.com/GetStream/stream-chat-swift/blob/main/CHANGELOG.md).")
41+
message("There seems to be app changes but CHANGELOG wasn't modified.\nPlease include an entry if the PR includes user-facing changes.\nYou can find it at [CHANGELOG.md](https://github.com/GetStream/stream-chat-swift/blob/main/CHANGELOG.md).")
4242
end
4343

4444
# Check all commits have correct format. Disable the length rule, since it's hardcoded
4545
# to 50 and GitHub has the limit 80.
46-
commit_lint.check disable: [:subject_length]
46+
commit_lint.check(disable: [:subject_length])

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
66

77
gem 'cocoapods'
88
gem 'danger'
@@ -12,7 +12,7 @@ gem 'fastlane-plugin-lizard'
1212
gem 'jazzy'
1313
gem 'json'
1414
gem 'plist'
15-
gem 'rubocop', '1.12.1'
15+
gem 'rubocop', '1.38'
1616
gem 'rubocop-performance'
1717
gem 'rubocop-require_tools'
1818
gem 'sinatra'

0 commit comments

Comments
 (0)