Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into kw-fix-capture-envelo…
Browse files Browse the repository at this point in the history
…pe-malformed-js-call
  • Loading branch information
krystofwoldrich committed May 15, 2023
2 parents 0c87592 + 01d5710 commit e68254c
Show file tree
Hide file tree
Showing 150 changed files with 11,761 additions and 4,386 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ module.exports = {
version: 'detect', // React version. "detect" automatically picks the version you have installed.
},
ignorePatterns: [
'test/react-native/versions/*',
'test/react-native/versions/**/*',
'coverage/**/*',
'test/typescript/**/*',
],
overrides: [
{
Expand Down Expand Up @@ -61,5 +62,6 @@ module.exports = {
'@sentry-internal/sdk/no-async-await': 'off',
'@sentry-internal/sdk/no-optional-chaining': 'off',
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
},
};
55 changes: 52 additions & 3 deletions .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
- uses: actions/cache@v3
id: cache
with:
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
- uses: actions/cache@v3
id: cache
with:
Expand All @@ -97,6 +97,16 @@ jobs:
run: yarn install
- name: Build
run: yarn build
- name: Archive dist
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: Archive ts3.8
uses: actions/upload-artifact@v3
with:
name: ts3.8
path: ts3.8
- name: Pack
run: yarn pack
- name: Archive Artifacts
Expand All @@ -106,6 +116,45 @@ jobs:
path: |
${{ github.workspace }}/*.tgz
job_type_check:
name: Type Check Typescript 3.8
runs-on: ubuntu-latest
needs: [job_build]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v3
id: cache
with:
path: test/typescript/ts3.8/node_modules
key: ${{ runner.os }}-${{ github.sha }}-ts3.8
- name: Download dist
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Download ts3.8
uses: actions/download-artifact@v3
with:
name: ts3.8
path: ts3.8
- name: Install Global Dependencies
run: yarn global add yalc
- name: Publish SDK
run: yalc publish
- name: Install SDK
working-directory: test/typescript/ts3.8
run: yalc add @sentry/react-native
- name: Install Dependencies
if: ${{ steps.cache.outputs['cache-hit'] != 'true' }}
working-directory: test/typescript/ts3.8
run: yarn install
- name: Type Check
working-directory: test/typescript/ts3.8
run: yarn type-check

job_bundle:
name: Bundle
runs-on: ubuntu-latest
Expand All @@ -120,7 +169,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: 16
- name: Cache Dependencies
uses: actions/cache@v3
id: cache
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
platform: ["android"] # "ios" will be added after codegen is fixed
platform: ["android", "ios"]
include:
- platform: android
command: |
cd sample-new-architecture/android
./gradlew generateCodegenArtifactsFromSchema
- platform: ios
command: |
cd sample-new-architecture/ios
node ../node_modules/react-native/scripts/generate-codegen-artifacts.js \
--path .. \
--outputPath codegen
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@a34ca99b4610d924e04c68db79e503e1f79f9f02 # pin@v2
uses: github/codeql-action/init@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # pin@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@a34ca99b4610d924e04c68db79e503e1f79f9f02 # pin@v2
uses: github/codeql-action/autobuild@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # pin@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
Expand All @@ -61,4 +61,4 @@ jobs:
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@a34ca99b4610d924e04c68db79e503e1f79f9f02 # pin@v2
uses: github/codeql-action/analyze@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # pin@v2
60 changes: 46 additions & 14 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
java-version: '11'
distribution: 'adopt'

- name: Install Global Dependencies
run: brew install xcbeautify

- name: NPM cache
uses: actions/cache@v3
id: deps-cache
Expand Down Expand Up @@ -94,21 +97,32 @@ jobs:
'-derivedDataPath' $(cd "DerivedData" ; pwd -P)
)
echo "buildArgs = ${buildArgs[@]}"
xcodebuild \
set -o pipefail && xcodebuild \
-workspace sample.xcworkspace \
-configuration Release \
-scheme sample \
"${buildArgs[@]}" \
build
xcodebuild \
build \
| tee sample-xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
set -o pipefail && xcodebuild \
-project ../node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
-scheme WebDriverAgentRunner \
GCC_TREAT_WARNINGS_AS_ERRORS=0 \
COMPILER_INDEX_STORE_ENABLE=NO \
"${buildArgs[@]}" \
build
build \
| tee webdriveragent-xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
fi
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-logs
path: ./sample/ios/*.log

metrics:
runs-on: macos-latest
strategy:
Expand All @@ -128,7 +142,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14"
node-version: 16
- uses: actions/setup-java@v3
with:
java-version: "11"
Expand All @@ -151,7 +165,7 @@ jobs:
run: yalc publish
- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: 16
- uses: actions/cache@v3
id: app-plain-cache
with:
Expand Down Expand Up @@ -231,11 +245,12 @@ jobs:
name: Build RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
runs-on: macos-latest
env:
RN_SENTRY_POD_NAME: RNSentry
RN_DIFF_REPOSITORY: https://github.com/react-native-community/rn-diff-purge.git
strategy:
fail-fast: false # keeps matrix running if one fails
matrix:
rn-version: ['0.65.3', '0.71.0']
rn-version: ['0.65.3', '0.71.3']
rn-architecture: ['legacy', 'new']
platform: ['android', 'ios']
build-type: ['dev', 'production']
Expand All @@ -255,8 +270,10 @@ jobs:
java-version: '11'
distribution: 'adopt'

- name: Setup JS Tools
run: yarn global add yalc semver
- name: Setup Global Tools
run: |
yarn global add yalc semver
brew install xcbeautify
- name: NPM cache SDK
uses: actions/cache@v3
Expand Down Expand Up @@ -316,6 +333,7 @@ jobs:
echo "ENABLE_PROD=$ENABLE_PROD"
echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH pod install
cat Podfile.lock | grep $RN_SENTRY_POD_NAME
- name: Patch App RN
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
Expand Down Expand Up @@ -358,14 +376,16 @@ jobs:
echo "Building $CONFIG"
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
xcodebuild \
set -o pipefail && xcodebuild \
-workspace RnDiffApp.xcworkspace \
-configuration "$CONFIG" \
-scheme RnDiffApp \
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
build
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Archive Android APK
if: matrix.platform == 'android' && matrix.build-type == 'production'
Expand Down Expand Up @@ -397,14 +417,21 @@ jobs:
path: app.tar
retention-days: 1

- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: rn-build-logs-${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}
path: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios/*.log

react-native-test:
name: Test RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
needs: react-native-build
runs-on: macos-latest
strategy:
fail-fast: false # keeps matrix running if one fails
matrix:
rn-version: ['0.65.3', '0.71.0']
rn-version: ['0.65.3', '0.71.3']
rn-architecture: ['legacy', 'new']
platform: ['android', 'ios']
build-type: ['production']
Expand All @@ -422,6 +449,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup Global Tools
run: brew install xcbeautify

- name: Download App Package
if: matrix.build-type == 'production'
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -456,15 +486,17 @@ jobs:
run: |
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
xcodebuild \
set -o pipefail && xcodebuild \
-project node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
-scheme WebDriverAgentRunner \
GCC_TREAT_WARNINGS_AS_ERRORS=0 \
COMPILER_INDEX_STORE_ENABLE=NO \
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
build
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Start Appium Server
working-directory: test/e2e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84
with:
repo-token: ${{ github.token }}
days-before-stale: 21
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ node_modules
build/
DerivedData
dist
ts3.8
coverage

## Various settings
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
!CHANGELOG.md
!README.md
!/dist/**/*
!ts3.8/**/*
!RNSentry.podspec
!sentry.gradle
!react-native.config.js
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/test/react-native/versions

7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "avoid",
"printWidth": 120,
"proseWrap": "always",
"singleQuote": true,
"trailingComma": "all"
}
Loading

0 comments on commit e68254c

Please sign in to comment.