Skip to content

Commit

Permalink
Update test_android_template to use build_npm_package (#33068)
Browse files Browse the repository at this point in the history
Summary:
I'm updating the `test_android_template` CI step to use the result of `build_npm_package` instead of sed-ing the RN version to `file:..`.
This should be more robust and will allow to install transitive deps automatically, without having to deal with separate installation steps.

This also fixes the broken CI for Android

Changelog:
[Internal] [Changed] - Update `test_android_template` to use `build_npm_package`

Pull Request resolved: #33068

Reviewed By: ShikaSD

Differential Revision: D34083047

Pulled By: cortinico

fbshipit-source-id: de34472d5737db445cfc0d4b1c6feaf1e746bb61
  • Loading branch information
cortinico authored and Andrei Shikov committed Feb 24, 2022
1 parent 1b2b219 commit 0924a28
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -569,20 +569,18 @@ jobs:
steps:
- checkout
- run_yarn
- attach_workspace:
at: .

- run:
name: Setup the Android Template
name: Create Android template project
command: |
REPO_ROOT=$(pwd)
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
cd template
# We replace the "react-native" dependency version with file:.. so we use it from source.
sed -i 's/\"react-native\"\:.*/\"react-native\"\: \"file\:\.\.\"/g' package.json
npm add $PATH_TO_PACKAGE
npm install
# react-native-community/cli is needed as the Android template is referencing a .gradle file inside it.
npm i @react-native-community/cli
- run:
name: Bundle the latest version of ReactAndroid
command: ./gradlew :ReactAndroid:publishReleasePublicationToNpmRepository
- run:
name: Build the template application
Expand Down Expand Up @@ -866,11 +864,6 @@ workflows:
- build_npm_package:
# Build a release package on every untagged commit, but do not publish to npm.
publish_npm_args: --dry-run
filters:
branches:
only:
- main
- /^pull\/.*$/
- test_js:
run_disabled_tests: false
filters:
Expand All @@ -882,6 +875,8 @@ workflows:
branches:
ignore: gh-pages
- test_android_template:
requires:
- build_npm_package
filters:
branches:
ignore: gh-pages
Expand Down

0 comments on commit 0924a28

Please sign in to comment.