forked from open-craft/problem-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
47 lines (47 loc) · 2.54 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
version: 2
jobs:
build:
docker:
- image: circleci/python:2.7.14
parallelism: 4
steps:
- checkout
- restore_cache:
key: dependencies-{{ checksum "circle.yml" }}-{{ checksum "requirements.txt" }}-{{ checksum "test_requirements.txt" }}
- run:
name: Install dependencies
command: |
virtualenv venv
. venv/bin/activate
pip install -U pip wheel
# Temporarily pin setuptools to a specific version.
# See commit message of https://github.com/open-craft/problem-builder/commit/51277a34fb426724616618c1afdb893ab2de4c6b for more info:
pip install setuptools==24.3.1
pip install -e git://github.com/edx/xblock-sdk.git@bddf9f4a2c6e4df28a411c8f632cc2250170ae9d#egg=xblock-sdk
pip install -r requirements.txt
pip install -r venv/src/xblock-sdk/requirements/base.txt
pip install -r venv/src/xblock-sdk/requirements/test.txt
pip uninstall -y xblock-problem-builder && python setup.py sdist && pip install dist/xblock-problem-builder-*.tar.gz
pip install -r test_requirements.txt
mkdir var
- save_cache:
key: dependencies-{{ checksum "circle.yml" }}-{{ checksum "requirements.txt" }}-{{ checksum "test_requirements.txt" }}
paths:
- "venv"
- run:
name: Install firefox 38.0.5
command: |
FIREFOX_URL="https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_38.0.5-0ubuntu1_amd64.deb/download" \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/firefox.deb $FIREFOX_URL \
&& sudo dpkg -i /tmp/firefox.deb || sudo apt-get -f install \
&& sudo apt-get install -y libgtk3.0-cil-dev libasound2 libasound2 libdbus-glib-1-2 libdbus-1-3 libgtk2.0-0 \
&& rm -rf /tmp/firefox.deb \
&& firefox --version
- run:
name: Run tests
command: |
. venv/bin/activate
if [ $CIRCLE_NODE_INDEX = '0' ]; then pep8 problem_builder --max-line-length=120; fi
if [ $CIRCLE_NODE_INDEX = '1' ]; then pylint problem_builder --disable=all --enable=function-redefined,undefined-variable,unused-import,unused-variable; fi
TESTFILES=$(circleci tests glob "problem_builder/v1/tests/**/*.py" "problem_builder/tests/**/*.py"| circleci tests split)
xvfb-run --server-args="-screen 0 1280x1024x24" python run_tests.py ${TESTFILES}