2018-06-29 02:05:36 -07:00
|
|
|
version: 2
|
|
|
|
|
jobs:
|
2018-07-11 12:25:23 -07:00
|
|
|
unit-test:
|
|
|
|
|
docker:
|
2018-07-20 11:42:15 -07:00
|
|
|
# Match target OS of TLJH
|
2018-07-20 11:36:51 -07:00
|
|
|
- image: ubuntu:18.04
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
working_directory: ~/repo
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-20 11:42:15 -07:00
|
|
|
# Setup Python
|
|
|
|
|
- run:
|
|
|
|
|
name: install python
|
|
|
|
|
command: |
|
2018-08-01 16:02:49 +02:00
|
|
|
apt-get update --yes && apt-get install --yes python3 python3-venv git
|
2018-07-20 11:42:15 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
# Download and cache dependencies
|
|
|
|
|
- restore_cache:
|
|
|
|
|
keys:
|
2018-07-20 11:49:34 -07:00
|
|
|
- v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
|
|
|
|
- v1-dependencies-py3.6-
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-23 14:54:25 -07:00
|
|
|
- run:
|
|
|
|
|
name: Setup venv
|
|
|
|
|
command: |
|
|
|
|
|
python3 -m venv /srv/venv
|
2018-08-01 16:02:49 +02:00
|
|
|
echo 'export PATH=/srv/venv/bin:$PATH' >> $BASH_ENV
|
2018-07-23 14:54:25 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: install dependencies
|
|
|
|
|
command: |
|
2018-08-01 16:02:49 +02:00
|
|
|
pip install -r dev-requirements.txt
|
|
|
|
|
pip install -e .
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- save_cache:
|
|
|
|
|
paths:
|
2018-07-23 14:54:25 -07:00
|
|
|
- /srv/venv/
|
2018-07-20 11:49:34 -07:00
|
|
|
key: v1-dependencies-py3.6-{{ checksum "setup.py" }}-{{ checksum "dev-requirements.txt" }}
|
2018-06-29 02:05:36 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: run unit tests
|
|
|
|
|
command: |
|
2018-08-01 16:02:49 +02:00
|
|
|
py.test --cov=tljh tests/
|
2018-07-11 13:15:49 -07:00
|
|
|
|
|
|
|
|
- run:
|
|
|
|
|
name: upload code coverage stats
|
|
|
|
|
command: |
|
2018-08-01 16:02:49 +02:00
|
|
|
codecov
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
integration-test:
|
|
|
|
|
docker:
|
|
|
|
|
- image: docker:18.05.0-ce-git
|
2018-07-11 12:16:46 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
steps:
|
|
|
|
|
- run:
|
|
|
|
|
name: setup python3
|
|
|
|
|
command: |
|
|
|
|
|
apk add --no-cache python3
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2018-07-11 12:27:01 -07:00
|
|
|
- checkout
|
2018-07-11 12:25:23 -07:00
|
|
|
- setup_remote_docker
|
2018-06-29 02:26:20 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
|
|
|
|
name: build systemd image
|
|
|
|
|
command: |
|
2018-08-11 11:01:45 -07:00
|
|
|
.circleci/integration-test.py build-image
|
2018-07-11 02:04:41 -07:00
|
|
|
|
2018-07-11 12:25:23 -07:00
|
|
|
- run:
|
2018-08-11 11:01:45 -07:00
|
|
|
name: Run basic tests tests
|
2018-07-11 12:25:23 -07:00
|
|
|
command: |
|
2018-08-11 11:01:45 -07:00
|
|
|
.circleci/integration-test.py run-test basic-tests test_hub.py test_install.py test_extensions.py
|
2018-06-29 03:12:16 -07:00
|
|
|
|
2018-07-11 12:33:19 -07:00
|
|
|
|
2018-07-11 12:21:57 -07:00
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
|
version: 2
|
2018-07-11 12:33:32 -07:00
|
|
|
all-tests:
|
2018-07-11 12:21:57 -07:00
|
|
|
jobs:
|
|
|
|
|
- unit-test
|
|
|
|
|
- integration-test
|