-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from GertjanBisschop/circleci
setup circleci
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
version: 2.1 | ||
orbs: | ||
codecov: codecov/[email protected] | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- image: cimg/python:3.7 | ||
working_directory: /home/circleci/tstrait | ||
steps: | ||
- checkout | ||
- run: sudo chown -R circleci:circleci * | ||
- restore_cache: | ||
# Note: we put a v{x} suffix at the end of the cache key so that | ||
# we can invalidate the cache when we need to. Note that we need | ||
# to update the key in the ``save_cache`` block below also when | ||
# doing that. | ||
key: tstrait-{{ .Branch }}-v4 | ||
- run: | ||
name: Install dependencies and set path | ||
command: | | ||
pip install --user -r requirements/CI-complete/requirements.txt | ||
pip install --user build twine | ||
# way to set path persistently https://circleci.com/docs/2.0/env-vars/#setting-path | ||
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV | ||
- save_cache: | ||
key: tstrait-{{ .Branch }}-v4 | ||
paths: | ||
- "/home/circleci/.local" | ||
|
||
- run: | ||
name: Run highlevel tests | ||
# Run tests without background threads | ||
command: | | ||
pytest --cov=tstrait --cov-report=xml --cov-branch -n 0 tests | ||
- codecov/upload: | ||
flags: python | ||
token: CODECOV_TOKEN | ||
|
||
- run: | ||
name: Delete coverage | ||
command: | | ||
rm .coverage | ||
- run: | ||
name: Make sure we can build a distribution. | ||
command: | | ||
python setup.py sdist | ||
python setup.py check | ||
python -m twine check dist/*.tar.gz --strict | ||
rm dist/* | ||
python -m build | ||
- run: | ||
name: Install from the distribution tarball | ||
command: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install --upgrade setuptools pip | ||
pip install dist/*.tar.gz | ||
python -c 'import tstrait' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
coverage: | ||
status: | ||
project: | ||
python: | ||
target: 95% | ||
flags: python | ||
|
||
patch: | ||
python: | ||
target: 90% | ||
flags: python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
msprime | ||
numba | ||
numpy | ||
pytest==6.2.5 | ||
pytest-cov==3.0.0 | ||
tskit==0.5.3 |