Skip to content

Commit

Permalink
Merge f0ee0eb into 36884bd
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Dec 14, 2022
2 parents 36884bd + f0ee0eb commit d091239
Show file tree
Hide file tree
Showing 285 changed files with 33,468 additions and 237 deletions.
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Ignore build generated dir
dist

# Ignore sample folder
# Ignore standalone apps
sample
sample-new-architecture
test/perf/TestApp*

# Ignore dangerfile
dangerfile.js
dangerfile.js
41 changes: 40 additions & 1 deletion .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

with:
node-version: 14
- uses: actions/cache@v3
id: cache
with:
Expand Down Expand Up @@ -42,12 +43,50 @@ jobs:
- name: Lint
run: yarn lint

job_lint_sample_new_arch:
name: Lint Sample
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache
with:
path: sample-new-architecture/node_modules
key: ${{ runner.os }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs['cache-hit'] != 'true'
run: yarn install
working-directory: sample-new-architecture
- name: Lint Sample
run: yarn lint
working-directory: sample-new-architecture

job_check_integrity:
name: Check package integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache
with:
path: node_modules
key: ${{ runner.os }}-${{ github.sha }}
- name: Save initial lock file
run: cp yarn.lock yarn.lock.initial
- name: Install Dependencies (update lock if necessary)
run: yarn install
- name: Check lock file integrity
run: |
["$(diff yarn.lock.initial yarn.lock)" -eq ""]
job_build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: actions/cache@v3
id: cache
with:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Codegen

on:
push:
branches:
- main
- release/**
pull_request:

jobs:
codegen:
runs-on: ubuntu-latest
strategy:
matrix:
platform: ["android"] # "ios" will be added after codegen is fixed
include:
- platform: android
command: |
cd sample-new-architecture/android
./gradlew generateCodegenArtifactsFromSchema
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: actions/cache@v3
id: cache
with:
path: sample-new-architecture/node_modules
key: ${{ runner.os }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs['cache-hit'] != 'true'
run: |
cd sample-new-architecture
yarn install
- name: Codegen
run: ${{ matrix.command }}
122 changes: 122 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

Expand Down Expand Up @@ -140,3 +144,121 @@ jobs:
path: |
./sample/*.log
./sample/*.png
metrics:
runs-on: macos-latest
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
matrix:
rn-architecture: ['legacy', 'new']
platform: ["ios", "android"]
include:
- platform: ios
name: iOS
appPlain: test/perf/test-app-plain.ipa
- platform: android
name: Android
appPlain: test/perf/TestAppPlain/android/app/build/outputs/apk/release/app-release.apk
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14"
- uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
- name: Install Global Dependencies
run: yarn global add react-native-cli @sentry/cli yalc
- uses: actions/cache@v3
id: deps-cache
with:
path: |
node_modules
test/perf/TestAppSentry/node_modules
key: ${{ github.workflow }}-${{ github.job }}-${{ hashFiles('yarn.lock', 'test/perf/TestAppSentry/yarn.lock') }}
- name: Install Dependencies
if: steps.deps-cache.outputs['cache-hit'] != 'true'
run: yarn install
- name: Build SDK
run: yarn build
- name: Package SDK
run: yalc publish
- uses: actions/setup-node@v3
with:
node-version: "16"
- uses: actions/cache@v3
id: app-plain-cache
with:
path: ${{ matrix.appPlain }}
# if the whole plain app folder is hashed the cache is never hit as there are files generated in the folder
# the cache key is calculated both at cache retrieval and save time
# hashFiles fails when there are rn android new arch generated files in the folder (exact reason unknown)
key: ${{ github.workflow }}-${{ github.job }}-appplain-${{ matrix.platform }}-${{ matrix.rn-architecture }}-${{ hashFiles('test/perf/TestAppPlain/yarn.lock') }}
- name: Build app plain
if: steps.app-plain-cache.outputs['cache-hit'] != 'true'
working-directory: ./test/perf/TestAppPlain
run: |
yarn install
cd ${{ matrix.platform }}
if [[ "${{ matrix.platform }}" == "android" ]]; then
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
fi
./gradlew assembleRelease
else
export PRODUCTION=1
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
pod install
cd ../..
fastlane build_perf_test_app_plain
fi
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Build app with Sentry
working-directory: ./test/perf/TestAppSentry
run: |
yalc add @sentry/react-native
yarn install
cd ${{ matrix.platform }}
if [[ "${{ matrix.platform }}" == "android" ]]; then
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
fi
./gradlew assembleRelease
else
export PRODUCTION=1
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
pod install
cd ../..
fastlane build_perf_test_app_sentry
cd TestAppSentry
fi
# Remove after build so that the cache isn't invaldiated due to the changes in yarn.lock.
yarn remove @sentry/react-native
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Collect apps metrics
uses: getsentry/action-app-sdk-overhead-metrics@v1
with:
name: ${{ matrix.name }} (${{ matrix.rn-architecture }})
config: ./test/perf/metrics-${{ matrix.platform }}.yml
sauce-user: ${{ secrets.SAUCE_USERNAME }}
sauce-key: ${{ secrets.SAUCE_ACCESS_KEY }}
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
force:
description: Force a release even when there are release-blockers (optional)
required: false
merge_target:
description: Target branch to merge into. Uses the default branch as a fallback (optional)
required: false

jobs:
job_release:
runs-on: ubuntu-latest
name: 'Release a new version'
name: "Release a new version"
steps:
- name: Check out current commit (${{ github.sha }})
uses: actions/checkout@v3
Expand All @@ -28,3 +31,4 @@ jobs:
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
merge_target: ${{ github.event.inputs.merge_target }}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
!react-native.config.js
!/ios/**/*
!/android/**/*
!src/js/NativeRNSentry.ts
!scripts/collect-modules.sh
Loading

0 comments on commit d091239

Please sign in to comment.