-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(sample): Remove old sample in favour of the new arch sample (#3118
- Loading branch information
1 parent
9c48b2c
commit 2d3b9f2
Showing
96 changed files
with
138 additions
and
14,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
dist | ||
|
||
# Ignore standalone apps | ||
sample | ||
sample-new-architecture | ||
test/perf/TestApp* | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.