mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Move analisys scripts to .github folder (#49123)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49123 Previously, we used to have CI workflows scripts in a `react-native/scripts/circleci` folder. Now that we are not using CircleCI anymore, we move those scripts to the `.github/workflow-scripts` folder. ## Changelog: [Internal] - Move ci scripts to the `.github/workflow-scripts` folder Reviewed By: cortinico, huntie Differential Revision: D69047581 fbshipit-source-id: 6a5d8525e526cc7521d42e2be9530deb09914fdc
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d654ae51bb
commit
ae7175d0ab
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
GITHUB_OWNER=${CIRCLE_PROJECT_USERNAME:-facebook}
|
||||
GITHUB_REPO=${CIRCLE_PROJECT_REPONAME:-react-native}
|
||||
export GITHUB_OWNER
|
||||
export GITHUB_REPO
|
||||
|
||||
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check --silent --json; echo google-java-format; node scripts/lint-java.js --diff) | node packages/react-native-bots/code-analysis-bot.js
|
||||
|
||||
STATUS=$?
|
||||
if [ $STATUS == 0 ]; then
|
||||
echo "Code analyzed successfully."
|
||||
else
|
||||
echo "Code analysis failed, error status $STATUS."
|
||||
fi
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
GITHUB_OWNER=${CIRCLE_PROJECT_USERNAME:-facebook}
|
||||
GITHUB_REPO=${CIRCLE_PROJECT_REPONAME:-react-native}
|
||||
export GITHUB_OWNER
|
||||
export GITHUB_REPO
|
||||
|
||||
if [ -x "$(command -v shellcheck)" ]; then
|
||||
IFS=$'\n'
|
||||
|
||||
if [ -n "$CIRCLE_CI" ]; then
|
||||
results=( "$(find . -type f -not -path "*node_modules*" -not -path "*third-party*" -name '*.sh' -exec sh -c 'shellcheck "$1" -f json' -- {} \;)" )
|
||||
|
||||
cat <(echo shellcheck; printf '%s\n' "${results[@]}" | jq .,[] | jq -s . | jq --compact-output --raw-output '[ (.[] | .[] | . ) ]') | GITHUB_PR_NUMBER="$GITHUB_PR_NUMBER" node packages/react-native-bots/code-analysis-bot.js
|
||||
# check status
|
||||
STATUS=$?
|
||||
if [ $STATUS == 0 ]; then
|
||||
echo "Shell scripts analyzed successfully."
|
||||
else
|
||||
echo "Shell script analysis failed, error status $STATUS."
|
||||
fi
|
||||
|
||||
else
|
||||
find . \
|
||||
-type f \
|
||||
-not -path "*node_modules*" \
|
||||
-not -path "*third-party*" \
|
||||
-name '*.sh' \
|
||||
-exec sh -c 'shellcheck "$1"' -- {} \;
|
||||
fi
|
||||
|
||||
else
|
||||
echo 'shellcheck is not installed. See https://github.com/facebook/react-native/wiki/Development-Dependencies#shellcheck for instructions.'
|
||||
exit 1
|
||||
fi
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
set -e
|
||||
|
||||
# Make sure we don't introduce accidental references to PATENTS.
|
||||
EXPECTED='.github/workflow-scripts/check_license.sh'
|
||||
ACTUAL=$(git grep -l PATENTS)
|
||||
|
||||
if [ "$EXPECTED" != "$ACTUAL" ]; then
|
||||
echo "PATENTS crept into some new files?"
|
||||
diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true
|
||||
exit 1
|
||||
fi
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# execute command
|
||||
"$@"
|
||||
|
||||
# check status
|
||||
STATUS=$?
|
||||
if [ $STATUS == 0 ]; then
|
||||
echo "Command " "$@" " completed successfully"
|
||||
else
|
||||
echo "Command " "$@" " exited with error status $STATUS"
|
||||
fi
|
||||
Reference in New Issue
Block a user