2020-05-18 22:24:05 +08:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
language: cpp
|
2020-08-18 17:55:14 +08:00
|
|
|
os:
|
|
|
|
- linux
|
2020-05-18 22:24:05 +08:00
|
|
|
dist: bionic
|
2020-05-30 05:22:13 +08:00
|
|
|
arch:
|
|
|
|
- s390x
|
|
|
|
- ppc64le
|
|
|
|
- amd64
|
2020-08-18 08:59:50 +08:00
|
|
|
env:
|
|
|
|
- NIGHTLY=true
|
|
|
|
- NIGHTLY=false
|
|
|
|
jobs:
|
|
|
|
allow_failures:
|
|
|
|
- env: NIGHTLY=true
|
2020-05-30 05:22:13 +08:00
|
|
|
script:
|
2020-08-18 08:59:50 +08:00
|
|
|
- export CPU_ARCH=$TRAVIS_CPU_ARCH
|
|
|
|
- if [ "$CPU_ARCH" == "amd64" ] ; then
|
|
|
|
export CPU_ARCH="x86";
|
|
|
|
fi
|
|
|
|
- echo "CPU Architecture is " $CPU_ARCH
|
2020-05-30 05:22:13 +08:00
|
|
|
- echo "commit is " $TRAVIS_COMMIT
|
|
|
|
- df -h
|
2020-08-18 08:59:50 +08:00
|
|
|
- if [ "$NIGHTLY" = true ] ; then
|
|
|
|
echo "Using nightly llvm-mlir image, build may fail.";
|
|
|
|
docker build --tag onnx-mlir-build:initial --build-arg BASE="onnxmlirczar/onnx-mlir-llvmimage:${CPU_ARCH}-nightly" -f ./docker/$CPU_ARCH.Dockerfile ./docker;
|
|
|
|
else
|
|
|
|
echo "Using latest compatible llvm-mlir image, build should not fail.";
|
|
|
|
docker build --tag onnx-mlir-build:initial --build-arg BASE="onnxmlirczar/onnx-mlir-llvmimage:$CPU_ARCH" -f ./docker/$CPU_ARCH.Dockerfile ./docker;
|
|
|
|
fi
|
2020-05-21 22:41:00 +08:00
|
|
|
- docker run -itd --name build onnx-mlir-build:initial
|
2020-05-30 05:22:13 +08:00
|
|
|
- echo "docker is running now"
|
|
|
|
- df -h
|
2020-05-21 22:41:00 +08:00
|
|
|
- docker cp $(pwd) build:/build/onnx-mlir
|
2020-05-18 22:24:05 +08:00
|
|
|
- cd docker
|
2020-08-18 20:41:19 +08:00
|
|
|
- chmod a+x compile-onnx-mlir.sh test-onnx-mlir.sh
|
2020-05-21 22:41:00 +08:00
|
|
|
- docker cp compile-onnx-mlir.sh build:/usr/bin/compile-onnx-mlir.sh
|
2020-08-18 20:41:19 +08:00
|
|
|
- docker cp test-onnx-mlir.sh build:/usr/bin/test-onnx-mlir.sh
|
2020-05-30 05:22:13 +08:00
|
|
|
- echo "about to execute build inside docker"
|
|
|
|
- docker exec build df -h
|
|
|
|
- docker exec build compile-onnx-mlir.sh
|
2020-08-18 20:41:19 +08:00
|
|
|
- docker exec build test-onnx-mlir.sh
|
2020-08-18 08:59:50 +08:00
|
|
|
- docker commit build onnxmlirczar/onnx-mlir-build:$CPU_ARCH
|
2020-05-21 22:41:00 +08:00
|
|
|
after_success:
|
2020-08-18 08:59:50 +08:00
|
|
|
- if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == "master" ] && [ $NIGHTLY == false ]; then
|
2020-05-21 22:41:00 +08:00
|
|
|
echo "Pushing new build to docker hub";
|
2020-07-25 01:31:43 +08:00
|
|
|
docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN";
|
2020-08-18 08:59:50 +08:00
|
|
|
docker push onnxmlirczar/onnx-mlir-build:$CPU_ARCH;
|
2020-05-21 22:41:00 +08:00
|
|
|
else
|
|
|
|
echo "Skip pushing build";
|
|
|
|
fi
|