gotch/.travis.yml
2020-10-13 17:23:11 +11:00

47 lines
1.7 KiB
YAML

language: go
go:
- 1.14.x
env:
- GO111MODULE=on
branches:
only:
- master
dist: bionic
before_install:
- ls -la
- sudo apt-get install clang-tools-9
- export GOTCH=$TRAVIS_BUILD_DIR
- export LIBTORCH_VERSION=${LIBTORCH_VER:-1.5.1}
- export LIBTORCH=${GOTCH}/libtch/libtorch
- export LIBRARY_PATH=${LIBTORCH}/lib
- export CPATH=${LIBTORCH}/lib:${LIBTORCH}/include:${LIBTORCH}/include/torch/csrc:${LIBTORCH}/include/torch/csrc/api/include
- export LD_LIBRARY_PATH=${LIBTORCH}/lib
# Precompiled libtorch
- sudo rm -rf $LIBTORCH
- sudo mkdir -p $LIBTORCH
- wget -O /tmp/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}+cpu.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}%2Bcpu.zip
- sudo unzip /tmp/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}+cpu.zip -d ${GOTCH}/libtch
- sudo rm ${GOTCH}/libtch/lib.go
- sudo cp ${GOTCH}/libtch/lib.go.cpu ${GOTCH}/libtch/lib.go
- sudo mv ${GOTCH}/libtch/dummy_cuda_dependency.cpp ${GOTCH}/libtch/dummy_cuda_dependency.cpp.gpu
- sudo mv ${GOTCH}/libtch/fake_cuda_dependency.cpp.cpu ${GOTCH}/libtch/fake_cuda_dependency.cpp
- cd $GOTCH
- go install
script:
- printenv
- export GOTCH=$TRAVIS_BUILD_DIR
- export LIBTORCH_VERSION=${LIBTORCH_VER:-1.5.1}
- export LIBTORCH=${GOTCH}/libtch/libtorch
- export LIBRARY_PATH=${LIBTORCH}/lib
- export CPATH=${LIBTORCH}/lib:${LIBTORCH}/include:${LIBTORCH}/include/torch/csrc:${LIBTORCH}/include/torch/csrc/api/include
- export LD_LIBRARY_PATH=${LIBTORCH}/lib
- go test -v github.com/sugarme/gotch/tensor
- go test -v github.com/sugarme/gotch/nn
- go test -v github.com/sugarme/gotch/vision