Skip to content

Commit

Permalink
chore(sample): Remove old sample in favour of the new arch sample (#3118
Browse files Browse the repository at this point in the history
)
  • Loading branch information
krystofwoldrich authored Jun 20, 2023
1 parent 9c48b2c commit 2d3b9f2
Show file tree
Hide file tree
Showing 96 changed files with 138 additions and 14,350 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
dist

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

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,20 @@ jobs:
uses: actions/cache@v3
id: cache-sample
with:
path: sample/node_modules
key: ${{ runner.os }}-${{ hashFiles('sample/yarn.lock') }}
path: sample-new-architecture/node_modules
key: ${{ runner.os }}-${{ hashFiles('sample-new-architecture/yarn.lock') }}
- name: Install Dependencies
if: ${{ steps.cache.outputs['cache-hit'] != 'true' }}
run: yarn install
- name: Install Sample Dependencies
if: ${{ steps.cache-sample.outputs['cache-hit'] != 'true' }}
run: yarn install
working-directory: sample
working-directory: sample-new-architecture
- name: Build
run: yarn build
- name: Make Sample Build Directory
run: mkdir build
working-directory: sample
working-directory: sample-new-architecture
- name: Bundle
run: |
yarn run react-native bundle \
Expand All @@ -203,4 +203,4 @@ jobs:
--reset-cache \
--bundle-output build/bundle.${{ matrix.platform }}.js \
--sourcemap-output build/bundle.${{ matrix.platform }}.map
working-directory: sample
working-directory: sample-new-architecture
102 changes: 0 additions & 102 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,108 +21,6 @@ jobs:
with:
access_token: ${{ github.token }}

sample:
# Android emulator said to perform best with macos HAXM
runs-on: macos-latest
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
matrix:
platform: ['ios', 'android']
include:
- platform: ios
runtime: 'latest'
device: 'iPhone 14'
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Install Global Dependencies
run: brew install xcbeautify

- name: NPM cache
uses: actions/cache@v3
id: deps-cache
with:
path: |
node_modules
sample/node_modules
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'sample/yarn.lock') }}

- name: iOS cache
if: ${{ matrix.platform == 'ios' }}
uses: actions/cache@v3
with:
path: |
sample/ios/Pods
sample/ios/DerivedData
# Note: we cannot use sample/ios/Podfile.lock because it's not source controlled.
key: ${{ github.workflow }}-${{ github.job }}-ios${{ matrix.runtime }}-${{ hashFiles('yarn.lock', 'sample/yarn.lock') }}

- name: Install Dependencies
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
run: yarn install

- name: Build SDK
run: yarn build

- name: Install Sample Dependencies
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
working-directory: ./sample
run: yarn install

- run: pod install
if: ${{ matrix.platform == 'ios' }}
env:
PRODUCTION: 1
working-directory: ./sample/ios

- name: Build ${{ matrix.platform }} sample app
if: ${{ env.SENTRY_AUTH_TOKEN != null }}
id: build
working-directory: ./sample/${{ matrix.platform }}
run: |
if [[ "${{ matrix.platform }}" == "android" ]]; then
./gradlew :app:assembleRelease -PreactNativeArchitectures=x86
else
mkdir -p DerivedData
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
buildArgs=(
'-destination' 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}'
'ONLY_ACTIVE_ARCH=yes'
'-derivedDataPath' $(cd "DerivedData" ; pwd -P)
)
echo "buildArgs = ${buildArgs[@]}"
set -o pipefail && xcodebuild \
-workspace sample.xcworkspace \
-configuration Release \
-scheme sample \
"${buildArgs[@]}" \
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 \
| 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 Down
119 changes: 119 additions & 0 deletions .github/workflows/sample-application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Sample Application

on:
push:
branches: [main]
pull_request:

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

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

jobs:
cancel-previous-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
with:
access_token: ${{ github.token }}

build:
name: Build ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
# Android emulator said to perform best with macos HAXM
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: ['android', 'ios']
build-type: ['dev', 'production']
include:
- platform: ios
runtime: 'latest'
device: 'iPhone 14'
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Install Global Dependencies
run: brew install xcbeautify

- name: NPM cache
uses: actions/cache@v3
id: deps-cache
with:
path: |
node_modules
sample-new-architecture/node_modules
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'sample-new-architecture/node_modules/yarn.lock') }}

- name: Install SDK Dependencies
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
run: yarn install

- name: Build SDK
run: yarn build

- name: Install Sample Dependencies
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
working-directory: sample-new-architecture
run: yarn install

- name: Install App Pods
if: ${{ matrix.platform == 'ios' }}
working-directory: sample-new-architecture/ios
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
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: Build Android App
if: ${{ matrix.platform == 'android' }}
working-directory: sample-new-architecture/android
run: |
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
echo 'New Architecture enabled'
fi
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
- name: Build iOS App
if: ${{ matrix.platform == 'ios' }}
working-directory: sample-new-architecture/ios
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace sampleNewArchitecture.xcworkspace \
-configuration "$CONFIG" \
-scheme sampleNewArchitecture \
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-logs
path: sample-new-architecture/ios/*.log
5 changes: 3 additions & 2 deletions .github/workflows/update-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ jobs:
sample-rn:
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
with:
path: sample/scripts/update-rn.sh
name: Sample React Native
path: scripts/update-rn.sh
name: React Native
pattern: '^v[0-9.]+$' # only match non-preview versions, also ignores "latest"
pr-strategy: update
changelog-entry: false
secrets:
api-token: ${{ secrets.CI_DEPLOY_KEY }}
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,5 @@ wheelhouse
.yalc/
yalc.lock

# Sample
sample/.vscode/.react/index.bundle
sample/.vscode/.react/index.map
sample/.vscode/.react/debuggerWorker.js

# E2E tests
sample/*.png
test/react-native/versions
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"editor.formatOnPaste": false,
"editor.formatOnSave": false
},
"react-native-tools.projectRoot": "./sample",
"react-native-tools.projectRoot": "./sample-new-architecture",
"dart.flutterAdbConnectOnChromeOs": false
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"lint:eslint": "eslint --config .eslintrc.js .",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test:watch": "jest --watch",
"run-ios": "cd sample && yarn react-native run-ios",
"run-android": "cd sample && yarn react-native run-android"
"run-ios": "cd sample-new-architecture && yarn react-native run-ios",
"run-android": "cd sample-new-architecture && yarn react-native run-android"
},
"keywords": [
"react-native",
Expand Down Expand Up @@ -110,7 +110,6 @@
"js"
],
"testPathIgnorePatterns": [
"<rootDir>/sample/",
"<rootDir>/test/e2e/"
],
"testEnvironment": "node",
Expand Down
6 changes: 0 additions & 6 deletions sample/.buckconfig

This file was deleted.

4 changes: 0 additions & 4 deletions sample/.eslintrc.js

This file was deleted.

Loading

0 comments on commit 2d3b9f2

Please sign in to comment.