From 0d7362d930fae96bfccb623275aa02f46c4eb353 Mon Sep 17 00:00:00 2001 From: Paymahn Moghadasian Date: Wed, 12 Dec 2018 08:25:06 -0700 Subject: [PATCH] Build and test backend without docker Build and test the backend without docker so that tests can be run against pull requests from forks. Fixes #17 --- .travis.yml | 45 +++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index ccfb083..32d313a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,3 @@ -image: docker:latest -language: python - -env: - global: - - DOCKER_DRIVER=overlay2 - - DOCKER_HOST=tcp://localhost:2375 - - - BASE_IMAGE_REGISTRY=gcr.io/mycrocoin - - BACKEND_IMAGE=${BASE_IMAGE_REGISTRY}/mycro-backend - - FRONTEND_IMAGE=${BASE_IMAGE_REGISTRY}/mycro-frontend - - TEST_IMAGE=${BASE_IMAGE_REGISTRY}/test - -stages: - - test - - jobs: include: - stage: unit test @@ -30,21 +13,27 @@ jobs: script: - npm run prettier-check - stage: unit test + language: python + python: + - "3.6" + dist: xenial services: - - docker - postgresql addons: postgresql: "9.6" + before_install: +# - echo $PATH +# - return 1 +# - sudo add-apt-repository -y ppa:ethereum/ethereum +# - sudo apt-get update -y + - sudo apt-get install -yq --no-install-recommends --no-install-suggests automake build-essential libffi-dev libgmp-dev libssl-dev libtool pkg-config python3-dev python3-pip software-properties-common + install: + - cd backend + - pip3 install -r requirements.txt + - python3 -m solc.install v0.4.24 + - ln -s /home/travis/.py-solc/solc-v0.4.24/bin/solc /usr/bin/solc before_script: - - docker login -u _json_key -p "$(echo $GCR_REGSITRY_SERVICE_ACCOUNT | base64 -d)" https://gcr.io - psql -c 'create database travis_ci_test;' -U postgres script: - # need to support branches with / in the their name. Do this by replacing / with - - - IMAGE_WITH_TAG=$TEST_IMAGE:${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} - - - docker pull $IMAGE_WITH_TAG || docker pull $TEST_IMAGE:latest || true - - docker build --cache-from $IMAGE_WITH_TAG --cache-from $TEST_IMAGE:latest -t $IMAGE_WITH_TAG -t $TEST_IMAGE:latest -f server.Dockerfile . - - docker push $IMAGE_WITH_TAG # push this first so we don't have to rebuild if tests fail - - docker run --net=host $IMAGE_WITH_TAG python manage.py test -v 2 - - docker push $TEST_IMAGE:latest - + - cd .. + - python manage.py test -v 2