Skip to content

Commit d4e2551

Browse files
[CI] Optimize public interface analyser installation (#900)
1 parent 77137ab commit d4e2551

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

.github/workflows/smoke-checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ jobs:
138138
steps:
139139
- uses: actions/[email protected]
140140
- uses: ./.github/actions/bootstrap
141+
env:
142+
INSTALL_INTERFACE_ANALYZER: true
141143
- run: bundle exec fastlane validate_public_interface
142144
- run: bundle exec fastlane lint_pr
143145
- run: bundle exec fastlane rubocop

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ StreamVideo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
1414
build/
1515
DerivedData/
1616
*.xcframework
17+
18+
# Interface Analyser
1719
stream-module-interface-analyser/
18-
public_interface_current.resolved
19-
public_interface_previous.resolved
20+
interface-analyser-report.md
21+
public_interface_current.*
22+
public_interface_previous.*
2023

2124
## Various settings
2225
*.pbxuser

Githubfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export YEETD_VERSION='1.0'
88
export MINT_VERSION='0.17.5'
99
export SONAR_VERSION='6.2.1.4610'
1010
export IPSW_VERSION='3.1.592'
11+
export INTERFACE_ANALYZER_VERSION='1.0.7'

Scripts/bootstrap.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,11 @@ if [[ ${INSTALL_IPSW-default} == true ]]; then
8787
chmod +x ipsw
8888
sudo mv ipsw /usr/local/bin/
8989
fi
90+
91+
if [[ ${INSTALL_INTERFACE_ANALYZER-default} == true ]]; then
92+
puts "Install interface-analyser v${INTERFACE_ANALYZER_VERSION}"
93+
FILE="interface-analyser"
94+
wget "https://github.com/GetStream/stream-module-interface-analyser/releases/download/v${INTERFACE_ANALYZER_VERSION}/${FILE}"
95+
chmod +x ${FILE}
96+
sudo mv ${FILE} /usr/local/bin/
97+
fi

fastlane/Fastfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -729,27 +729,23 @@ end
729729
lane :validate_public_interface do
730730
next unless is_check_required(sources: sources_matrix[:public_interface], force_check: @force_check)
731731

732-
analyser = 'interface-analyser'
733-
sh("wget -P . https://github.com/GetStream/stream-module-interface-analyser/releases/download/v1.0.7/interface-analyser")
734-
sh("chmod +x #{analyser}")
735-
736732
# Run the analysis on the current branch
737733
original_branch = current_branch
738-
sh("./#{analyser} analysis ../Sources/ ../public_interface_current.json")
734+
sh('interface-analyser analysis ../Sources/ public_interface_current.json')
739735

740736
# Checkout the target branch
741737
target_branch = original_branch.include?('release/') ? 'main' : 'develop'
742738
sh("git fetch origin #{target_branch}")
743739
sh("git checkout #{target_branch}")
744740

745741
# Run the analysis on the target branch
746-
sh("./#{analyser} analysis ../Sources/ ../public_interface_previous.json")
742+
sh('interface-analyser analysis ../Sources/ public_interface_previous.json')
747743

748744
# Run diff
749-
report_path = '../report.md'
750-
sh("./#{analyser} diff ../public_interface_current.json ../public_interface_previous.json #{report_path}")
745+
report_path = 'interface-analyser-report.md'
746+
sh("interface-analyser diff public_interface_current.json public_interface_previous.json #{report_path}")
751747

752-
# Check if report.md exists and is non-zero in size
748+
# Check if report exists and is non-zero in size
753749
diff =
754750
if File.exist?(report_path) && File.size(report_path) > 0
755751
File.read(report_path).strip

0 commit comments

Comments
 (0)