-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Pull Request resolved: #44870 This just simplifies the build_android step on GHA Changelog: [Internal] [Changed] - Simplify build_android Reviewed By: cipolleschi Differential Revision: D58407537 fbshipit-source-id: 2bb34ef8b8d1883e653914488d4d417356f0f1d2
- Loading branch information
1 parent
3c3c687
commit d0012b7
Showing
5 changed files
with
59 additions
and
121 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 |
---|---|---|
@@ -1,14 +1,9 @@ | ||
name: Setup gradle | ||
description: 'Set up your GitHub Actions workflow with a specific version of gradle' | ||
inputs: | ||
gradle-version: | ||
description: 'The node.js version to use' | ||
required: false | ||
default: '8.6' | ||
description: "Set up your GitHub Actions workflow with a specific version of gradle" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: ${{ inputs.gradle-version }} | ||
gradle-version: wrapper |
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 |
---|---|---|
|
@@ -490,15 +490,13 @@ jobs: | |
name: hermes-win64-bin | ||
path: D:\tmp\hermes\win64-bin\ | ||
build_android: | ||
runs-on: 16-core-ubuntu | ||
needs: [set_release_type, prepare_hermes_workspace] | ||
runs-on: 8-core-ubuntu | ||
needs: [set_release_type] | ||
container: | ||
image: reactnativecommunity/react-native-android:latest | ||
env: | ||
TERM: "dumb" | ||
GRADLE_OPTS: '-Dorg.gradle.daemon=false' | ||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. | ||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" | ||
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -512,32 +510,31 @@ jobs: | |
uses: ./.github/actions/setup-gradle | ||
- name: Build and publish all the Android Artifacts to /tmp/maven-local | ||
run: | | ||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. | ||
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then | ||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a" | ||
else | ||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64" | ||
fi | ||
./gradlew publishAllToMavenTempLocal | ||
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true | ||
shell: bash | ||
- name: Cache android build artifacts | ||
uses: actions/cache/[email protected] | ||
- name: Upload test results | ||
if: ${{ always() }} | ||
uses: actions/[email protected] | ||
with: | ||
key: android-build-cache-${{ github.run_number}} | ||
name: build-android-results | ||
compression-level: 1 | ||
path: | | ||
build | ||
packages/rn-tester/android/app/.cxx | ||
packages/rn-tester/android/app/build | ||
packages/react-native/sdks/download | ||
packages/react-native/sdks/hermes | ||
packages/react-native/ReactAndroid/.cxx | ||
packages/react-native/ReactAndroid/build | ||
packages/react-native/ReactAndroid/hermes-engine/.cxx | ||
packages/react-native/ReactAndroid/hermes-engine/build | ||
packages/react-native/ReactAndroid/src/main/jni/prebuilt | ||
packages/react-native-gradle-plugin/.gradle | ||
packages/react-native-gradle-plugin/build | ||
packages/react-native-codegen/lib | ||
enableCrossOsArchive: true | ||
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports | ||
packages/react-native-gradle-plugin/settings-plugin/build/reports | ||
packages/react-native/ReactAndroid/build/reports | ||
- name: Upload RNTester APK | ||
if: ${{ always() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: rntester-apk | ||
path: packages/rn-tester/android/app/build/outputs/apk/ | ||
compression-level: 0 | ||
build_npm_package: | ||
runs-on: 8-core-ubuntu | ||
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android] | ||
|
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 |
---|---|---|
|
@@ -488,15 +488,13 @@ jobs: | |
name: hermes-win64-bin | ||
path: D:\tmp\hermes\win64-bin\ | ||
build_android: | ||
runs-on: 16-core-ubuntu | ||
needs: [set_release_type, prepare_hermes_workspace] | ||
runs-on: 8-core-ubuntu | ||
needs: [set_release_type] | ||
container: | ||
image: reactnativecommunity/react-native-android:latest | ||
env: | ||
TERM: "dumb" | ||
GRADLE_OPTS: '-Dorg.gradle.daemon=false' | ||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. | ||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" | ||
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -510,32 +508,31 @@ jobs: | |
uses: ./.github/actions/setup-gradle | ||
- name: Build and publish all the Android Artifacts to /tmp/maven-local | ||
run: | | ||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. | ||
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then | ||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a" | ||
else | ||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64" | ||
fi | ||
./gradlew publishAllToMavenTempLocal | ||
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true | ||
shell: bash | ||
- name: Cache android build artifacts | ||
uses: actions/cache/[email protected] | ||
- name: Upload test results | ||
if: ${{ always() }} | ||
uses: actions/[email protected] | ||
with: | ||
key: android-build-cache-${{ github.run_number}} | ||
name: build-android-results | ||
compression-level: 1 | ||
path: | | ||
build | ||
packages/rn-tester/android/app/.cxx | ||
packages/rn-tester/android/app/build | ||
packages/react-native/sdks/download | ||
packages/react-native/sdks/hermes | ||
packages/react-native/ReactAndroid/.cxx | ||
packages/react-native/ReactAndroid/build | ||
packages/react-native/ReactAndroid/hermes-engine/.cxx | ||
packages/react-native/ReactAndroid/hermes-engine/build | ||
packages/react-native/ReactAndroid/src/main/jni/prebuilt | ||
packages/react-native-gradle-plugin/.gradle | ||
packages/react-native-gradle-plugin/build | ||
packages/react-native-codegen/lib | ||
enableCrossOsArchive: true | ||
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports | ||
packages/react-native-gradle-plugin/settings-plugin/build/reports | ||
packages/react-native/ReactAndroid/build/reports | ||
- name: Upload RNTester APK | ||
if: ${{ always() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: rntester-apk | ||
path: packages/rn-tester/android/app/build/outputs/apk/ | ||
compression-level: 0 | ||
build_npm_package: | ||
runs-on: 8-core-ubuntu | ||
needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android] | ||
|
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 |
---|---|---|
|
@@ -561,14 +561,12 @@ jobs: | |
path: D:\tmp\hermes\win64-bin\ | ||
build_android: | ||
runs-on: 8-core-ubuntu | ||
needs: [set_release_type, prepare_hermes_workspace] | ||
needs: [set_release_type] | ||
container: | ||
image: reactnativecommunity/react-native-android:latest | ||
env: | ||
TERM: "dumb" | ||
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | ||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. | ||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -582,86 +580,31 @@ jobs: | |
uses: ./.github/actions/setup-gradle | ||
- name: Build and publish all the Android Artifacts to /tmp/maven-local | ||
run: | | ||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. | ||
if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then | ||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a" | ||
else | ||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64" | ||
fi | ||
./gradlew publishAllToMavenTempLocal | ||
./gradlew publishAllToMavenTempLocal build -PenableWarningsAsErrors=true | ||
shell: bash | ||
- name: Cache android build artifacts | ||
uses: actions/cache/[email protected] | ||
with: | ||
key: android-build-cache-${{ github.run_number}} | ||
path: | | ||
build | ||
packages/rn-tester/android/app/.cxx | ||
packages/rn-tester/android/app/build | ||
packages/react-native/sdks/download | ||
packages/react-native/sdks/hermes | ||
packages/react-native/ReactAndroid/.cxx | ||
packages/react-native/ReactAndroid/build | ||
packages/react-native/ReactAndroid/hermes-engine/.cxx | ||
packages/react-native/ReactAndroid/hermes-engine/build | ||
packages/react-native/ReactAndroid/src/main/jni/prebuilt | ||
packages/react-native-gradle-plugin/.gradle | ||
packages/react-native-gradle-plugin/build | ||
packages/react-native-codegen/lib | ||
enableCrossOsArchive: true | ||
test_android: | ||
runs-on: 8-core-ubuntu | ||
needs: [prepare_hermes_workspace, build_android] | ||
container: | ||
image: reactnativecommunity/react-native-android:latest | ||
env: | ||
TERM: "dumb" | ||
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | ||
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. | ||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" | ||
# Repeated here, as the environment key in this executor will overwrite the one in defaults | ||
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }} | ||
PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Setup node.js | ||
uses: ./.github/actions/setup-node | ||
- name: Install dependencies | ||
run: yarn install --non-interactive | ||
- name: Set React Native Version | ||
run: node ./scripts/releases/set-rn-version.js --build-type dry-run | ||
- name: Cache android build artifacts | ||
uses: actions/[email protected] | ||
with: | ||
key: android-build-cache-${{ github.run_number}} | ||
path: | | ||
build | ||
packages/rn-tester/android/app/.cxx | ||
packages/rn-tester/android/app/build | ||
packages/react-native/sdks/download | ||
packages/react-native/sdks/hermes | ||
packages/react-native/ReactAndroid/.cxx | ||
packages/react-native/ReactAndroid/build | ||
packages/react-native/ReactAndroid/hermes-engine/.cxx | ||
packages/react-native/ReactAndroid/hermes-engine/build | ||
packages/react-native/ReactAndroid/src/main/jni/prebuilt | ||
packages/react-native-gradle-plugin/.gradle | ||
packages/react-native-gradle-plugin/build | ||
packages/react-native-codegen/lib | ||
- name: Build & Test React Native using Gradle | ||
run: ./gradlew build -PenableWarningsAsErrors=true | ||
- name: Upload test results | ||
if: ${{ always() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: android-test-results | ||
path: packages/react-native-gradle-plugin/build/test-results | ||
- name: Upload android package | ||
name: build-android-results | ||
compression-level: 1 | ||
path: | | ||
packages/react-native-gradle-plugin/react-native-gradle-plugin/build/reports | ||
packages/react-native-gradle-plugin/settings-plugin/build/reports | ||
packages/react-native/ReactAndroid/build/reports | ||
- name: Upload RNTester APK | ||
if: ${{ always() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: rntester-apk | ||
path: packages/rn-tester/android/app/build/outputs/apk/ | ||
compression-level: 0 | ||
build_npm_package: | ||
runs-on: 8-core-ubuntu | ||
needs: | ||
|
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