mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
83 lines
2.2 KiB
YAML
83 lines
2.2 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: |
|
|
.circleci/integration-test.py build-image
|
|
|
|
- run:
|
|
name: Run basic tests tests
|
|
command: |
|
|
.circleci/integration-test.py run-test basic-tests test_hub.py test_install.py test_extensions.py
|
|
|
|
|
|
|
|
workflows:
|
|
version: 2
|
|
all-tests:
|
|
jobs:
|
|
- unit-test
|
|
- integration-test
|