Skip to content

Commit

Permalink
Merge pull request #39 from GertjanBisschop/circleci
Browse files Browse the repository at this point in the history
setup circleci
  • Loading branch information
GertjanBisschop authored Jul 6, 2023
2 parents 7029d4a + d6ba1fd commit 221bb11
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .circleci/config.yml
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'
11 changes: 11 additions & 0 deletions .codecov.yaml
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
6 changes: 6 additions & 0 deletions requirements/CI-complete/requirements.txt
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

0 comments on commit 221bb11

Please sign in to comment.