Skip to content
8 changes: 7 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[run]
source = avalon

[paths]
# Remap source root path in docker
source =
avalon
/workspace/avalon

[report]
include = *avalon*
omit =
*/vendor*
*/tests*
*/run_*
*/run_*
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
language: python

python:
- 2.7
- 3.7

services:
- docker

install:
- pip install coverage==4.5.4
- pip install python-coveralls
- docker run --name avalon-mongo -d mongo
- docker build -t avalon/core -f Dockerfile-maya2016 .
- . build_docker.sh

script:
- . test_docker.sh
- . build_docs.sh

after_success:
- coverage combine
- coveralls

before_deploy:
- sudo chmod -R 777 docs/build/
- cd docs/build
Expand Down
17 changes: 7 additions & 10 deletions Dockerfile-maya2016
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && \
mayapy -m pip install \
nose \
nose-exclude \
coverage==4.5.4 \
pyblish-base==1.4.2 \
coverage \
pyblish-base \
pyblish-maya \
pymongo \
# Sphinx 1.8.0 fail to build doc, pin version to 1.7.9
# see https://github.com/sphinx-doc/sphinx/issues/5417
sphinx==1.7.9 \
sphinx \
six \
sphinxcontrib-napoleon \
python-coveralls
sphinxcontrib-napoleon

# Avoid creation of auxilliary files
# Avoid creation of auxiliary files
ENV PYTHONDONTWRITEBYTECODE=1

WORKDIR /workspace

ENTRYPOINT \
PYTHONPATH=$(pwd):$PYTHONPATH mayapy -u run_maya_tests.py && \
mayapy -c "import sys, os, coveralls;coveralls.wear() if os.getenv('TRAVIS_JOB_ID') else sys.stdout.write('Skipping coveralls')"
PYTHONPATH=$(pwd):$PYTHONPATH && \
mayapy -u run_maya_tests.py
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- job: MacOS
pool:
vmImage: "macOS-10.13" # High-Sierra
vmImage: "macOS-10.15" # Catalina
strategy:
matrix:
Python27:
Expand Down
2 changes: 1 addition & 1 deletion build_docker.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker build -t avalon/core -f Dockerfile-maya2016 .
docker build -t avalon/core:maya -f Dockerfile-maya2016 .
20 changes: 10 additions & 10 deletions build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
docker run \
--rm \
-v $(pwd):/workspace \
--link avalon-mongo:mongo \
-e AVALON_SILENT \
-e AVALON_MONGO=mongodb://mongo:27017 \
-e PYTHONPATH=/workspace:/usr/local/lib/python2.6/site-packages \
--entrypoint mayapy \
--workdir /workspace/docs \
avalon/core \
-m sphinx source build -E -v
--rm \
--volume $(pwd):/workspace \
--link avalon-mongo:mongo \
--env AVALON_SILENT \
--env AVALON_MONGO=mongodb://mongo:27017 \
--env PYTHONPATH=/workspace:/usr/local/lib/python2.6/site-packages \
--entrypoint mayapy \
--workdir /workspace/docs \
avalon/core:maya \
-m sphinx source build -E -v
20 changes: 12 additions & 8 deletions test_docker.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

# Run Maya test
docker run \
--rm \
-v $(pwd):/workspace \
--link avalon-mongo:mongo \
-e COVERALLS_REPO_TOKEN \
-e TRAVIS_JOB_ID \
-e AVALON_SILENT \
-e AVALON_MONGO=mongodb://mongo:27017 \
avalon/core
--rm \
--volume $(pwd):/workspace \
--link avalon-mongo:mongo \
--env AVALON_SILENT \
--env AVALON_MONGO=mongodb://mongo:27017 \
avalon/core:maya
# Rename coverage data file and will be combined later
mv .coverage .coverage.maya

# docker run other DCC tools..