Files
the-littlest-jupyterhub/.circleci/config.yml
Tim Head b48b55e3bd Add documentation build to CI, warnings as errors
Adds a CircleCI job to build the documentation and makes it so that
sphinx warnings are treated as errors.
2018-08-11 08:10:41 +02:00

153 lines
4.6 KiB
YAML

version: 2
jobs:
unit-test:
docker:
# Match target OS of TLJH
- image: ubuntu:18.04
working_directory: ~/repo
steps:
- checkout
# Setup Python
- run:
name: install python
command: |
apt-get update --yes && apt-get install --yes python3 python3-venv git
# Download and cache dependencies
- restore_cache:
keys:
- 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
- run:
name: install dependencies
command: |
pip install -r dev-requirements.txt
pip install -e .
- save_cache:
paths:
- /srv/venv/
key: v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
- run:
name: run unit tests
command: |
py.test --cov=tljh tests/
- run:
name: upload code coverage stats
command: |
codecov
integration-test:
docker:
- image: docker:18.05.0-ce-git
steps:
- run:
name: setup python3
command: |
apk add --no-cache python3
- checkout
- setup_remote_docker
- run:
name: build systemd image
command: |
python3 .circleci/integration-test.py build-image
- run:
name: start systemd image
command: |
python3 .circleci/integration-test.py start-container
- run:
name: run tljh installer
command: |
python3 .circleci/integration-test.py copy . /srv/src
python3 .circleci/integration-test.py run 'python3 /srv/src/bootstrap/bootstrap.py'
- run:
name: switch to dummyauthenticator
command: |
python3 .circleci/integration-test.py run '/opt/tljh/hub/bin/tljh-config set auth.type dummyauthenticator.DummyAuthenticator'
python3 .circleci/integration-test.py run '/opt/tljh/hub/bin/tljh-config reload'
- run:
name: print systemd status + logs
command: |
python3 .circleci/integration-test.py run 'journalctl --no-pager'
python3 .circleci/integration-test.py run 'systemctl --no-pager status jupyterhub configurable-http-proxy'
- run:
name: install integration test requirements
command: |
python3 .circleci/integration-test.py run 'python3 -m pip install -r /srv/src/integration-tests/requirements.txt'
- run:
name: run integration tests
command: |
python3 .circleci/integration-test.py run 'python3 -m pytest -v /srv/src/integration-tests'
documentation:
docker:
# Match target OS of TLJH
- image: ubuntu:18.04
working_directory: ~/repo
steps:
- checkout
# Setup Python
- run:
name: install python
command: |
apt-get update --yes && apt-get install --yes python3 python3-venv git
# 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
- run:
name: install dependencies
command: |
pip install sphinx
- save_cache:
paths:
- /srv/venv/
key: v1-dependencies-py3.6-sphinx
- run:
name: build documentation
command: |
cd docs
make html
workflows:
version: 2
all-tests:
jobs:
- unit-test
- integration-test
- documentation