Skip to content

Commit 2d3b9f2

Browse files
chore(sample): Remove old sample in favour of the new arch sample (#3118)
1 parent 9c48b2c commit 2d3b9f2

File tree

96 files changed

+138
-14350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+138
-14350
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
dist
33

44
# Ignore standalone apps
5-
sample
65
sample-new-architecture
76
test/perf/TestApp*
87

.github/workflows/buildandtest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,20 @@ jobs:
180180
uses: actions/cache@v3
181181
id: cache-sample
182182
with:
183-
path: sample/node_modules
184-
key: ${{ runner.os }}-${{ hashFiles('sample/yarn.lock') }}
183+
path: sample-new-architecture/node_modules
184+
key: ${{ runner.os }}-${{ hashFiles('sample-new-architecture/yarn.lock') }}
185185
- name: Install Dependencies
186186
if: ${{ steps.cache.outputs['cache-hit'] != 'true' }}
187187
run: yarn install
188188
- name: Install Sample Dependencies
189189
if: ${{ steps.cache-sample.outputs['cache-hit'] != 'true' }}
190190
run: yarn install
191-
working-directory: sample
191+
working-directory: sample-new-architecture
192192
- name: Build
193193
run: yarn build
194194
- name: Make Sample Build Directory
195195
run: mkdir build
196-
working-directory: sample
196+
working-directory: sample-new-architecture
197197
- name: Bundle
198198
run: |
199199
yarn run react-native bundle \
@@ -203,4 +203,4 @@ jobs:
203203
--reset-cache \
204204
--bundle-output build/bundle.${{ matrix.platform }}.js \
205205
--sourcemap-output build/bundle.${{ matrix.platform }}.map
206-
working-directory: sample
206+
working-directory: sample-new-architecture

.github/workflows/e2e.yml

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -21,108 +21,6 @@ jobs:
2121
with:
2222
access_token: ${{ github.token }}
2323

24-
sample:
25-
# Android emulator said to perform best with macos HAXM
26-
runs-on: macos-latest
27-
strategy:
28-
# we want that the matrix keeps running, default is to cancel them if it fails.
29-
fail-fast: false
30-
matrix:
31-
platform: ['ios', 'android']
32-
include:
33-
- platform: ios
34-
runtime: 'latest'
35-
device: 'iPhone 14'
36-
steps:
37-
- uses: actions/checkout@v3
38-
39-
- uses: actions/setup-java@v3
40-
with:
41-
java-version: '11'
42-
distribution: 'adopt'
43-
44-
- name: Install Global Dependencies
45-
run: brew install xcbeautify
46-
47-
- name: NPM cache
48-
uses: actions/cache@v3
49-
id: deps-cache
50-
with:
51-
path: |
52-
node_modules
53-
sample/node_modules
54-
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'sample/yarn.lock') }}
55-
56-
- name: iOS cache
57-
if: ${{ matrix.platform == 'ios' }}
58-
uses: actions/cache@v3
59-
with:
60-
path: |
61-
sample/ios/Pods
62-
sample/ios/DerivedData
63-
# Note: we cannot use sample/ios/Podfile.lock because it's not source controlled.
64-
key: ${{ github.workflow }}-${{ github.job }}-ios${{ matrix.runtime }}-${{ hashFiles('yarn.lock', 'sample/yarn.lock') }}
65-
66-
- name: Install Dependencies
67-
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
68-
run: yarn install
69-
70-
- name: Build SDK
71-
run: yarn build
72-
73-
- name: Install Sample Dependencies
74-
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
75-
working-directory: ./sample
76-
run: yarn install
77-
78-
- run: pod install
79-
if: ${{ matrix.platform == 'ios' }}
80-
env:
81-
PRODUCTION: 1
82-
working-directory: ./sample/ios
83-
84-
- name: Build ${{ matrix.platform }} sample app
85-
if: ${{ env.SENTRY_AUTH_TOKEN != null }}
86-
id: build
87-
working-directory: ./sample/${{ matrix.platform }}
88-
run: |
89-
if [[ "${{ matrix.platform }}" == "android" ]]; then
90-
./gradlew :app:assembleRelease -PreactNativeArchitectures=x86
91-
else
92-
mkdir -p DerivedData
93-
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
94-
buildArgs=(
95-
'-destination' 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}'
96-
'ONLY_ACTIVE_ARCH=yes'
97-
'-derivedDataPath' $(cd "DerivedData" ; pwd -P)
98-
)
99-
echo "buildArgs = ${buildArgs[@]}"
100-
set -o pipefail && xcodebuild \
101-
-workspace sample.xcworkspace \
102-
-configuration Release \
103-
-scheme sample \
104-
"${buildArgs[@]}" \
105-
build \
106-
| tee sample-xcodebuild.log \
107-
| xcbeautify --quieter --is-ci --disable-colored-output
108-
set -o pipefail && xcodebuild \
109-
-project ../node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
110-
-scheme WebDriverAgentRunner \
111-
GCC_TREAT_WARNINGS_AS_ERRORS=0 \
112-
COMPILER_INDEX_STORE_ENABLE=NO \
113-
"${buildArgs[@]}" \
114-
build \
115-
| tee webdriveragent-xcodebuild.log \
116-
| xcbeautify --quieter --is-ci --disable-colored-output
117-
fi
118-
119-
- name: Upload logs
120-
if: ${{ always() }}
121-
uses: actions/upload-artifact@v3
122-
with:
123-
name: ${{ matrix.platform }}-logs
124-
path: ./sample/ios/*.log
125-
12624
metrics:
12725
runs-on: macos-latest
12826
strategy:
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Sample Application
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
14+
RN_SENTRY_POD_NAME: RNSentry
15+
16+
jobs:
17+
cancel-previous-workflow:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Cancel Previous Runs
21+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0
22+
with:
23+
access_token: ${{ github.token }}
24+
25+
build:
26+
name: Build ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
27+
# Android emulator said to perform best with macos HAXM
28+
runs-on: macos-latest
29+
strategy:
30+
# we want that the matrix keeps running, default is to cancel them if it fails.
31+
fail-fast: false
32+
matrix:
33+
rn-architecture: ['legacy', 'new']
34+
platform: ['android', 'ios']
35+
build-type: ['dev', 'production']
36+
include:
37+
- platform: ios
38+
runtime: 'latest'
39+
device: 'iPhone 14'
40+
steps:
41+
- uses: actions/checkout@v3
42+
43+
- uses: actions/setup-java@v3
44+
with:
45+
java-version: '11'
46+
distribution: 'adopt'
47+
48+
- name: Install Global Dependencies
49+
run: brew install xcbeautify
50+
51+
- name: NPM cache
52+
uses: actions/cache@v3
53+
id: deps-cache
54+
with:
55+
path: |
56+
node_modules
57+
sample-new-architecture/node_modules
58+
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'sample-new-architecture/node_modules/yarn.lock') }}
59+
60+
- name: Install SDK Dependencies
61+
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
62+
run: yarn install
63+
64+
- name: Build SDK
65+
run: yarn build
66+
67+
- name: Install Sample Dependencies
68+
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
69+
working-directory: sample-new-architecture
70+
run: yarn install
71+
72+
- name: Install App Pods
73+
if: ${{ matrix.platform == 'ios' }}
74+
working-directory: sample-new-architecture/ios
75+
run: |
76+
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
77+
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
78+
echo "ENABLE_PROD=$ENABLE_PROD"
79+
echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
80+
PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH pod install
81+
cat Podfile.lock | grep $RN_SENTRY_POD_NAME
82+
83+
- name: Build Android App
84+
if: ${{ matrix.platform == 'android' }}
85+
working-directory: sample-new-architecture/android
86+
run: |
87+
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
88+
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
89+
echo 'New Architecture enabled'
90+
fi
91+
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
92+
echo "Building $CONFIG"
93+
./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
94+
95+
- name: Build iOS App
96+
if: ${{ matrix.platform == 'ios' }}
97+
working-directory: sample-new-architecture/ios
98+
run: |
99+
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
100+
echo "Building $CONFIG"
101+
mkdir -p "DerivedData"
102+
derivedData="$(cd "DerivedData" ; pwd -P)"
103+
set -o pipefail && xcodebuild \
104+
-workspace sampleNewArchitecture.xcworkspace \
105+
-configuration "$CONFIG" \
106+
-scheme sampleNewArchitecture \
107+
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
108+
ONLY_ACTIVE_ARCH=yes \
109+
-derivedDataPath "$derivedData" \
110+
build \
111+
| tee xcodebuild.log \
112+
| xcbeautify --quieter --is-ci --disable-colored-output
113+
114+
- name: Upload logs
115+
if: ${{ always() }}
116+
uses: actions/upload-artifact@v3
117+
with:
118+
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-logs
119+
path: sample-new-architecture/ios/*.log

.github/workflows/update-deps.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ jobs:
5959
sample-rn:
6060
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
6161
with:
62-
path: sample/scripts/update-rn.sh
63-
name: Sample React Native
62+
path: scripts/update-rn.sh
63+
name: React Native
6464
pattern: '^v[0-9.]+$' # only match non-preview versions, also ignores "latest"
6565
pr-strategy: update
66+
changelog-entry: false
6667
secrets:
6768
api-token: ${{ secrets.CI_DEPLOY_KEY }}

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,5 @@ wheelhouse
7272
.yalc/
7373
yalc.lock
7474

75-
# Sample
76-
sample/.vscode/.react/index.bundle
77-
sample/.vscode/.react/index.map
78-
sample/.vscode/.react/debuggerWorker.js
79-
8075
# E2E tests
81-
sample/*.png
8276
test/react-native/versions

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"editor.formatOnPaste": false,
2424
"editor.formatOnSave": false
2525
},
26-
"react-native-tools.projectRoot": "./sample",
26+
"react-native-tools.projectRoot": "./sample-new-architecture",
2727
"dart.flutterAdbConnectOnChromeOs": false
2828
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"lint:eslint": "eslint --config .eslintrc.js .",
3333
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
3434
"test:watch": "jest --watch",
35-
"run-ios": "cd sample && yarn react-native run-ios",
36-
"run-android": "cd sample && yarn react-native run-android"
35+
"run-ios": "cd sample-new-architecture && yarn react-native run-ios",
36+
"run-android": "cd sample-new-architecture && yarn react-native run-android"
3737
},
3838
"keywords": [
3939
"react-native",
@@ -110,7 +110,6 @@
110110
"js"
111111
],
112112
"testPathIgnorePatterns": [
113-
"<rootDir>/sample/",
114113
"<rootDir>/test/e2e/"
115114
],
116115
"testEnvironment": "node",

sample/.buckconfig

Lines changed: 0 additions & 6 deletions
This file was deleted.

sample/.eslintrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)