Skip to content

feat: Implement SDK Size analysis on CI #2612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
e06217e
Refactoring
testableapple Aug 6, 2024
0a817a7
Implement SDK size analysis
testableapple Aug 8, 2024
af410ed
Update
testableapple Aug 8, 2024
e1a2e1a
Add android bundle option
testableapple Aug 8, 2024
0209df3
Test yaml
testableapple Aug 9, 2024
e1dc6bb
Merge branch 'develop' into ci/show-sdk-size
testableapple Aug 9, 2024
67ad81e
Update
testableapple Aug 9, 2024
f12c900
Add java
testableapple Aug 9, 2024
4ad4a6e
Andd android cli
testableapple Aug 9, 2024
ad6687d
Test
testableapple Aug 9, 2024
e397897
Update
testableapple Aug 9, 2024
58f5018
Update
testableapple Aug 9, 2024
b5a6553
Merge branch 'develop' into ci/show-sdk-size
testableapple Aug 9, 2024
53af9ea
Test
testableapple Aug 9, 2024
04def92
Connect bot
testableapple Aug 9, 2024
8552c1a
Test
testableapple Aug 9, 2024
e4b3d16
Test iOS
testableapple Aug 9, 2024
496d085
Test
testableapple Aug 9, 2024
99d9238
Test all
testableapple Aug 9, 2024
f389d17
Move some actions to plugin
testableapple Aug 9, 2024
82d2873
Test
testableapple Aug 9, 2024
d435722
Test
testableapple Aug 9, 2024
e774ea8
Update SDK names
testableapple Aug 9, 2024
f9a4e92
Fix typo
testableapple Aug 9, 2024
69e398e
Update
testableapple Aug 9, 2024
e94f90e
Test
testableapple Aug 12, 2024
3a0d373
Update
testableapple Aug 12, 2024
3bc6f84
Update
testableapple Aug 12, 2024
8c406e0
Update
testableapple Aug 12, 2024
03ece67
Update
testableapple Aug 12, 2024
5587cf1
update
testableapple Aug 12, 2024
a2a1d3a
Merge branch 'develop' into ci/show-sdk-size
testableapple Aug 12, 2024
c71fb4d
Update
testableapple Aug 12, 2024
364b905
Update
testableapple Aug 12, 2024
8e97736
Update
testableapple Aug 12, 2024
289f048
Update actions
testableapple Aug 12, 2024
26ff2b8
Extract RN version
testableapple Aug 12, 2024
bfb9939
Test apk size
testableapple Aug 12, 2024
4e94408
Remove test code
testableapple Aug 12, 2024
2655459
Bump plugin version
testableapple Aug 13, 2024
5a47de2
Bump plugin version
testableapple Aug 13, 2024
3a40037
[CI] Add space to SDK size badge
testableapple Aug 14, 2024
b3720a3
Update
testableapple Aug 16, 2024
fb34441
fix
testableapple Aug 16, 2024
6e1d8f8
Update
testableapple Aug 19, 2024
e962ef8
Merge branch 'develop' into ci/show-sdk-size
testableapple Aug 19, 2024
372ed9f
Update
testableapple Aug 19, 2024
f684e01
Test
testableapple Aug 19, 2024
817262d
Merge branch 'develop' into ci/show-sdk-size
testableapple Aug 19, 2024
031a468
Update readme
testableapple Aug 19, 2024
41b3304
Test
testableapple Aug 19, 2024
d60a9ec
Test
testableapple Aug 19, 2024
05b94b6
Test
testableapple Aug 19, 2024
d65c9ee
Test
testableapple Aug 19, 2024
2a098ca
Update
testableapple Aug 19, 2024
1c7caa4
Test again
testableapple Aug 19, 2024
57adb05
Test
testableapple Aug 19, 2024
7f1ad0e
Fix api key
testableapple Aug 19, 2024
3e03734
Test
testableapple Aug 19, 2024
23eece5
Test
testableapple Aug 19, 2024
4d8a884
Test
testableapple Aug 19, 2024
c6d4b90
Test
testableapple Aug 19, 2024
ec5b953
Fix
testableapple Aug 19, 2024
83b6fc4
Test
testableapple Aug 19, 2024
eaec2ab
Test
testableapple Aug 19, 2024
e98ee64
Test
testableapple Aug 19, 2024
1359356
Update
testableapple Aug 19, 2024
7acb5b4
Set up a minimum ruby version
testableapple Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/actions/install-and-build-sdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ runs:
yarn
shell: bash
- name: Install & Build the Sample App
run: |
cd examples/SampleApp/
yarn
working-directory: examples/SampleApp
run: yarn
shell: bash
10 changes: 10 additions & 0 deletions .github/actions/ruby-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Ruby Cache'
description: 'Cache Ruby dependencies'
runs:
using: "composite"
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
working-directory: examples/SampleApp
67 changes: 0 additions & 67 deletions .github/workflows/legacy-sample-distribution.yml

This file was deleted.

34 changes: 11 additions & 23 deletions .github/workflows/sample-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ jobs:
name: Build SampleApp iOS and Deploy-${{ github.ref == 'refs/heads/develop' }}
runs-on: [macos-14]
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
- name: Install Ruby and Gems
uses: ruby/setup-ruby@v1
- name: Connect Bot
uses: webfactory/ssh-agent@v0.7.0
with:
working-directory: examples/SampleApp
bundler-cache: true
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- uses: actions/checkout@v2
- uses: ./.github/actions/ruby-cache
- name: Install && Build - SDK and Sample App
uses: ./.github/actions/install-and-build-sdk
- name: Cache iOS pods
Expand All @@ -34,24 +32,15 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-
- name: iOS Pods setup
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: |
cd examples/SampleApp
cd ios
bundle exec pod install
working-directory: examples/SampleApp/ios
run: bundle exec pod install
- name: Build and release Testflight QA
working-directory: examples/SampleApp
run: bundle exec fastlane deploy_to_testflight_qa deploy:${{ github.ref == 'refs/heads/develop' }};
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
run: |
cd examples/SampleApp
bundle exec fastlane deploy_to_testflight_qa deploy:${{ github.ref == 'refs/heads/develop' }};
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}

build_and_deploy_android_s3:
name: Build SampleApp Android and Deploy-${{ github.ref == 'refs/heads/develop' }}
Expand All @@ -66,14 +55,13 @@ jobs:
- name: Install && Build - SDK and Sample App
uses: ./.github/actions/install-and-build-sdk
- name: Build
working-directory: examples/SampleApp
run: |
cd examples/SampleApp
mkdir android/app/src/main/assets
mkdir tmp
yarn react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest tmp
cd android
rm -rf $HOME/.gradle/caches/ && ./gradlew assembleRelease

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
if: ${{ github.ref == 'refs/heads/develop' }}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/sdk-size-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: SDK Size

on:
pull_request:

workflow_dispatch:

push:
branches:
- develop
- main

env:
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI

jobs:
sdk_size:
name: Metrics
runs-on: ubuntu-latest
steps:
- name: Connect Bot
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}

- uses: actions/checkout@v3.1.0

- uses: ./.github/actions/ruby-cache

- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'

- name: Run SDK Size Metrics
run: bundle exec fastlane show_frameworks_sizes update_readme:$UPDATE_README open_pr:$UPDATE_README
working-directory: examples/SampleApp
timeout-minutes: 60
env:
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }}
UPDATE_README: ${{ github.ref == 'refs/heads/main' }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ e2e/.env
.DS_STORE
*.db
.idea

# Testing
examples/SampleApp/fastlane/fastlane.log
examples/SampleApp/fastlane/report.xml
examples/SampleApp/fastlane/metrics/
examples/SampleApp/tmp/
index.android.bundle
*.app
*.DSYM.zip
**/metrics/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native)
[![Build Status](https://github.com/GetStream/stream-chat-react-native/actions/workflows/release.yml/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions)
[![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative)
![JS Bundle Size](https://img.shields.io/badge/js_bundle_size-439%20KB-blue)

<img align="right" src="https://getstream.imgix.net/images/ios-chat-tutorial/iphone_chat_art@3x.png?auto=format,enhance" width="50%" />

Expand Down
1 change: 0 additions & 1 deletion examples/SampleApp/.ruby-version

This file was deleted.

10 changes: 6 additions & 4 deletions examples/SampleApp/Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
# You may use http://rbenv.org to install and use this version
ruby '>= 3.1'

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'fastlane'
gem 'rubocop-performance'
gem 'rubocop-require_tools'

gem "fastlane"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
62 changes: 48 additions & 14 deletions examples/SampleApp/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GEM
base64
nkf
rexml
activesupport (7.0.8.1)
activesupport (7.0.8.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -16,18 +16,19 @@ GEM
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
artifactory (3.0.17)
ast (2.4.2)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.962.0)
aws-sdk-core (3.201.3)
aws-partitions (1.966.0)
aws-sdk-core (3.201.5)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.88.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.157.0)
aws-sdk-s3 (1.158.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -77,7 +78,7 @@ GEM
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.4)
declarative (0.0.20)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
Expand Down Expand Up @@ -158,11 +159,13 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-firebase_app_distribution (0.9.0)
fastlane-plugin-firebase_app_distribution (0.9.1)
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
google-apis-firebaseappdistribution_v1alpha (~> 0.2.0)
fastlane-plugin-load_json (0.0.1)
ffi (1.16.3)
fastlane-plugin-stream_actions (0.3.65)
xctest_list (= 1.2.1)
ffi (1.17.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
Expand Down Expand Up @@ -207,18 +210,19 @@ GEM
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.6)
http-cookie (1.0.7)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.14.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jmespath (1.6.2)
json (2.7.2)
jwt (2.8.2)
base64
language_server-protocol (3.17.0.3)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.22.2)
minitest (5.25.1)
molinillo (0.8.0)
multi_json (1.15.0)
multipart-post (2.4.1)
Expand All @@ -229,18 +233,44 @@ GEM
nkf (0.2.0)
optparse (0.5.0)
os (1.1.4)
parallel (1.26.3)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
plist (3.7.1)
public_suffix (4.0.7)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.4)
rexml (3.3.5)
strscan
rouge (2.0.7)
rubocop (1.65.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.1)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-require_tools (0.1.2)
rubocop (>= 0.49.1)
ruby-macho (2.5.1)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.5)
Expand Down Expand Up @@ -279,6 +309,7 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
xctest_list (1.2.1)

PLATFORMS
ruby
Expand All @@ -289,9 +320,12 @@ DEPENDENCIES
fastlane
fastlane-plugin-firebase_app_distribution
fastlane-plugin-load_json
fastlane-plugin-stream_actions (= 0.3.65)
rubocop-performance
rubocop-require_tools

RUBY VERSION
ruby 2.7.5p203
ruby 3.3.4p94

BUNDLED WITH
2.3.21
2.5.17
Loading
Loading