mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
enable sc1090 and sc1091 (#54069)
Summary: SC1090/1091 are important to prevent accidental delete/move of utility shell scripts Pull Request resolved: https://github.com/pytorch/pytorch/pull/54069 Test Plan: CI Reviewed By: samestep Differential Revision: D27084094 Pulled By: walterddr fbshipit-source-id: 16deb83fce691eba0263978374564d172bc8d371
This commit is contained in:
parent
2c4a64589b
commit
6332fd6255
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
# Anywhere except $ROOT_DIR should work. This is so the python import doesn't
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
# CMAKE_ARGS are only passed to 'cmake' and the -Dfoo=bar does not work with
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
# Skip tests in environments where they are not built/applicable
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
disable=SC2086
|
||||
disable=SC1091
|
||||
disable=SC2155
|
||||
disable=SC1090
|
||||
disable=SC2164
|
||||
disable=SC1003
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
echo "Clang version:"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ set -eu -o pipefail
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
echo "Clang version:"
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ set -eu -o pipefail
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
# Install torch & torchvision - used to download & trace test model.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ set -ex
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
if [[ "$BUILD_ENVIRONMENT" == *-linux-xenial-py3-clang5-asan* ]]; then
|
||||
|
|
@ -123,6 +124,7 @@ fi
|
|||
|
||||
if [[ "$BUILD_ENVIRONMENT" != *android* && "$BUILD_ENVIRONMENT" == *vulkan-linux* ]]; then
|
||||
export USE_VULKAN=1
|
||||
# shellcheck disable=SC1091
|
||||
source /var/lib/jenkins/vulkansdk/setup-env.sh
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ set -eu -o pipefail
|
|||
if [ "$#" -eq 0 ]; then
|
||||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
OUT="$(dirname "${BASH_SOURCE[0]}")/../../codegen_result"
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Common setup for all Jenkins scripts
|
||||
# shellcheck source=./common_utils.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common_utils.sh"
|
||||
set -ex
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="docker-build-test"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
docker build -t pytorch .
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
echo "Testing pytorch docs"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z "${BUILD_ENVIRONMENT}" ] || [[ "${BUILD_ENVIRONMENT}" == *-build* ]]; then
|
||||
# shellcheck source=./macos-build.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/macos-build.sh"
|
||||
fi
|
||||
|
||||
if [ -z "${BUILD_ENVIRONMENT}" ] || [[ "${BUILD_ENVIRONMENT}" == *-test* ]]; then
|
||||
# shellcheck source=./macos-test.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/macos-test.sh"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
# shellcheck source=./macos-common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/macos-common.sh"
|
||||
|
||||
export CMAKE_PREFIX_PATH=${WORKSPACE_DIR}/miniconda3/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ sysctl -a | grep machdep.cpu
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
export PATH="/usr/local/bin:$PATH"
|
||||
export WORKSPACE_DIR="${HOME}/workspace"
|
||||
|
|
@ -25,6 +26,7 @@ if [ ! -d "${WORKSPACE_DIR}/miniconda3" ]; then
|
|||
retry bash ${WORKSPACE_DIR}/miniconda3.sh -b -p ${WORKSPACE_DIR}/miniconda3
|
||||
fi
|
||||
export PATH="${WORKSPACE_DIR}/miniconda3/bin:$PATH"
|
||||
# shellcheck disable=SC1090
|
||||
source ${WORKSPACE_DIR}/miniconda3/bin/activate
|
||||
retry conda install -y mkl mkl-include numpy=1.18.5 pyyaml=5.3 setuptools=46.0.0 cmake cffi ninja typing_extensions dataclasses pip
|
||||
# The torch.hub tests make requests to GitHub.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# shellcheck disable=SC1090
|
||||
# shellcheck source=./macos-common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/macos-common.sh"
|
||||
|
||||
git submodule sync --recursive
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
# shellcheck source=./macos-common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/macos-common.sh"
|
||||
|
||||
conda install -y six
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
echo "Testing pytorch (distributed only)"
|
||||
|
|
|
|||
|
|
@ -42,9 +42,13 @@ if [[ "$COMMIT_SOURCE" == master ]]; then
|
|||
fi
|
||||
|
||||
# Include tests
|
||||
# shellcheck source=./perf_test/test_cpu_speed_mini_sequence_labeler.sh
|
||||
. ./test_cpu_speed_mini_sequence_labeler.sh
|
||||
# shellcheck source=./perf_test/test_cpu_speed_mnist.sh
|
||||
. ./test_cpu_speed_mnist.sh
|
||||
# shellcheck source=./perf_test/test_cpu_speed_torch.sh
|
||||
. ./test_cpu_speed_torch.sh
|
||||
# shellcheck source=./perf_test/test_cpu_speed_torch_tensor.sh
|
||||
. ./test_cpu_speed_torch_tensor.sh
|
||||
|
||||
# Run tests
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="short-perf-test-gpu"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
pushd .jenkins/pytorch/perf_test
|
||||
|
|
@ -41,10 +42,15 @@ if [[ "$COMMIT_SOURCE" == master ]]; then
|
|||
fi
|
||||
|
||||
# Include tests
|
||||
# shellcheck source=./perf_test/test_gpu_speed_mnist.sh
|
||||
. ./test_gpu_speed_mnist.sh
|
||||
# shellcheck source=./perf_test/test_gpu_speed_word_language_model.sh
|
||||
. ./test_gpu_speed_word_language_model.sh
|
||||
# shellcheck source=./perf_test/test_gpu_speed_cudnn_lstm.sh
|
||||
. ./test_gpu_speed_cudnn_lstm.sh
|
||||
# shellcheck source=./perf_test/test_gpu_speed_lstm.sh
|
||||
. ./test_gpu_speed_lstm.sh
|
||||
# shellcheck source=./perf_test/test_gpu_speed_mlstm.sh
|
||||
. ./test_gpu_speed_mlstm.sh
|
||||
|
||||
# Run tests
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
# shellcheck disable=SC2034
|
||||
COMPACT_JOB_NAME="${BUILD_ENVIRONMENT}"
|
||||
|
||||
# shellcheck source=./common.sh
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
||||
|
||||
echo "Testing pytorch"
|
||||
|
|
@ -333,6 +334,7 @@ test_backward_compatibility() {
|
|||
set -x
|
||||
pushd test/backward_compatibility
|
||||
python -m venv venv
|
||||
# shellcheck disable=SC1091
|
||||
. venv/bin/activate
|
||||
pip_install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
|
||||
pip show torch
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ fi
|
|||
COMPACT_JOB_NAME=pytorch-win-ws2019-cuda10-cudnn7-py3-build
|
||||
|
||||
SCRIPT_PARENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
# shellcheck source=./common.sh
|
||||
source "$SCRIPT_PARENT_DIR/common.sh"
|
||||
|
||||
export IMAGE_COMMIT_ID=$(git rev-parse HEAD)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ set -ex
|
|||
COMPACT_JOB_NAME=pytorch-win-ws2019-cuda10-cudnn7-py3-test
|
||||
|
||||
SCRIPT_PARENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
# shellcheck source=./common.sh
|
||||
source "$SCRIPT_PARENT_DIR/common.sh"
|
||||
|
||||
export IMAGE_COMMIT_ID=$(git rev-parse HEAD)
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@
|
|||
# .jenkins/run-shellcheck.sh --color=always | less -R
|
||||
|
||||
|
||||
find .jenkins/pytorch -name *.sh | xargs shellcheck --external-sources "$@"
|
||||
find .jenkins/pytorch -name *.sh | xargs shellcheck --external-sources -P SCRIPTDIR "$@"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user