diff --git a/.circleci/config.yml b/.circleci/config.yml index 5fc3973..d2f48ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,22 @@ -version: 2 +version: 2.1 +commands: + setup_venv: + description: Setup hub venv + steps: + - run: + name: Setup venv + command: | + python3 -m venv /srv/venv + echo 'export PATH=/srv/venv/bin:$PATH' >> $BASH_ENV + + install_python: + description: Install python3, venv, git and make + steps: + - run: + name: install python + command: | + apt-get update --yes && apt-get install --yes python3 python3-venv git make + jobs: unit-test: docker: @@ -11,10 +29,7 @@ jobs: - checkout # Setup Python - - run: - name: install python - command: | - apt-get update --yes && apt-get install --yes python3 python3-venv git + - install_python # Download and cache dependencies - restore_cache: @@ -22,12 +37,7 @@ jobs: - v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }} - v1-dependencies-py3.6- - - run: - name: Setup venv - command: | - python3 -m venv /srv/venv - echo 'export PATH=/srv/venv/bin:$PATH' >> $BASH_ENV - + - setup_venv - run: name: install dependencies command: | @@ -59,7 +69,7 @@ jobs: command: | apk add --no-cache python3 pytest - # - checkout + - checkout - setup_remote_docker - run: @@ -103,21 +113,13 @@ jobs: - checkout # Setup Python - - run: - name: install python - command: | - apt-get update --yes && apt-get install --yes python3 python3-venv git make + - install_python # Download and cache dependencies - restore_cache: key: v1-dependencies-py3.6-sphinx - - run: - name: Setup venv - command: | - python3 -m venv /srv/venv - echo 'export PATH=/srv/venv/bin:$PATH' >> $BASH_ENV - + - setup_venv - run: name: install dependencies command: |