| # From https://docs.travis-ci.com/user/environment-variables |
| git remote add upstream https://github.com/pytorch/pytorch |
| git fetch upstream "$TRAVIS_BRANCH" |
| BASE_BRANCH="upstream/$TRAVIS_BRANCH" |
| if [[ ! -d build ]]; then |
| git submodule update --init --recursive |
| # We really only need compile_commands.json, so no need to build! |
| time cmake -DBUILD_TORCH=ON .. |
| time python aten/src/ATen/gen.py \ |
| aten/src/ATen/Declarations.cwrap \ |
| aten/src/THNN/generic/THNN.h \ |
| aten/src/THCUNN/generic/THCUNN.h \ |
| aten/src/ATen/native/native_functions.yaml |
| # Generate PyTorch files. |
| time python tools/setup_helpers/generate_code.py \ |
| --declarations-path build/aten/src/ATen/Declarations.yaml \ |
| # The negative filters below are to exclude files that include onnx_pb.h, |
| # otherwise we'd have to build ONNX protos as part of this CI job. |
| time python tools/clang_tidy.py \ |
| -g"-torch/csrc/distributed/Module.cpp" \ |
| -g"-torch/csrc/jit/export.cpp" \ |
| -g"-torch/csrc/jit/import.cpp" \ |