services: - docker language: cpp os: - linux dist: bionic arch: - s390x - ppc64le - amd64 env: - NIGHTLY=true - NIGHTLY=false jobs: allow_failures: - env: NIGHTLY=true script: - export CPU_ARCH=$TRAVIS_CPU_ARCH - if [ "$CPU_ARCH" == "amd64" ] ; then export CPU_ARCH="x86"; fi - echo "CPU Architecture is " $CPU_ARCH - echo "commit is " $TRAVIS_COMMIT - df -h - 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 - docker run -itd --name build onnx-mlir-build:initial - echo "docker is running now" - df -h - docker cp $(pwd) build:/build/onnx-mlir - cd docker - chmod a+x compile-onnx-mlir.sh test-onnx-mlir.sh - docker cp compile-onnx-mlir.sh build:/usr/bin/compile-onnx-mlir.sh - docker cp test-onnx-mlir.sh build:/usr/bin/test-onnx-mlir.sh - echo "about to execute build inside docker" - docker exec build df -h - docker exec build compile-onnx-mlir.sh - docker exec build test-onnx-mlir.sh - docker commit build onnxmlirczar/onnx-mlir-build:$CPU_ARCH after_success: - if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == "master" ] && [ $NIGHTLY == false ]; then echo "Pushing new build to docker hub"; docker login -u onnxmlirczar -p "$DOCKER_HUB_TOKEN"; docker push onnxmlirczar/onnx-mlir-build:$CPU_ARCH; else echo "Skip pushing build"; fi