Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#test pr only
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
47 changes: 45 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,57 @@
#
# Copyright 2018-2020 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

language: python

python:
- 3.6

services:
- docker

before_install:
# Replace all slashes (which are common in branch names) in VERSION with dashes for Docker compatibility
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then
VERSION=latest;
else
VERSION=${TRAVIS_BRANCH//\//-};
fi

# Default variables (used by Jenkins)
- '[[ -z "$DOCKERFILE" ]] && export DOCKERFILE=Dockerfile || /bin/true'
- '[[ -z "$IMAGE" ]] && export IMAGE=test || /bin/true'
- '[[ -z "$ARCH" ]] && export ARCH=x86_64 || /bin/true'
- '[[ -z "$VERSION" ]] && export VERSION=jenkins || /bin/true'

install:
- docker build -t max-audio-classifier .
- docker run -it -d -p 5000:5000 max-audio-classifier
- docker build -f "$DOCKERFILE" -t codait/max-audio-classifier:"$IMAGE"-"$ARCH"-"$VERSION" .
- docker run -it -d --rm -p 5000:5000 codait/max-audio-classifier:"$IMAGE"-"$ARCH"-"$VERSION"
- pip install pytest requests flake8

before_script:
- flake8 . --max-line-length=127
- sleep 30

script:
- pytest tests/test.py

matrix:
include:
- os: linux
env: DOCKERFILE=Dockerfile IMAGE=test ARCH=x86_64
- os: linux
arch: arm64
env: DOCKERFILE=Dockerfile.arm32v7 IMAGE=arm ARCH=arm32v7