|
| 1 | +version: 2 |
| 2 | +jobs: |
| 3 | + build: |
| 4 | + docker: |
| 5 | + - image: circleci/python:3.6-stretch |
| 6 | + working_directory: /home/circleci/tskit |
| 7 | + steps: |
| 8 | + - checkout |
| 9 | + - run: sudo chown -R circleci:circleci * |
| 10 | + # - restore_cache: |
| 11 | + # key: tskit-{{ .Branch }} |
| 12 | + - run: |
| 13 | + name: Checkout submodules |
| 14 | + command: | |
| 15 | + git submodule update --init --recursive --remote |
| 16 | + - run: |
| 17 | + name: Install dependencies and set path |
| 18 | + command: | |
| 19 | + sudo apt-get install ninja-build libcunit1-dev valgrind clang doxygen libgsl-dev |
| 20 | + pip install --user -r python/requirements/development.txt |
| 21 | + pip install meson --user |
| 22 | + # tmp; until we have an msprime package install from here. |
| 23 | + pip install --user --pre --upgrade tskit |
| 24 | + pip install --user git+https://github.com/tskit-dev/msprime |
| 25 | + echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV |
| 26 | + # - save_cache: |
| 27 | + # key: tskit-{{ .Branch }} |
| 28 | + # paths: |
| 29 | + # - "/home/circleci/.local" |
| 30 | + - run: |
| 31 | + name: Compile Python |
| 32 | + command: | |
| 33 | + cd python |
| 34 | + # CFLAGS="--coverage -Wall -Wextra -Werror -Wno-unused-parameter" \ |
| 35 | + # python setup.py build_ext --inplace |
| 36 | + # TODO enable these flags later. |
| 37 | + CFLAGS="--coverage" python setup.py build_ext --inplace |
| 38 | + - run: |
| 39 | + name: Lint Python |
| 40 | + command: | |
| 41 | + cd python |
| 42 | + flake8 --max-line-length 89 tskit setup.py tests |
| 43 | + - run: |
| 44 | + name: Run Python tests |
| 45 | + command: | |
| 46 | + PYTHONPATH=python nosetests -v --with-coverage --cover-package tskit \ |
| 47 | + --cover-branches --cover-erase --cover-xml \ |
| 48 | + --cover-inclusive python/tests |
| 49 | + python3 -m codecov -F python |
| 50 | + - run: |
| 51 | + name: Build Python package |
| 52 | + command: | |
| 53 | + cd python |
| 54 | + rm -fR build |
| 55 | + python setup.py sdist |
| 56 | + python setup.py check |
| 57 | + python -m venv venv |
| 58 | + source venv/bin/activate |
| 59 | + pip install --upgrade setuptools pip wheel |
| 60 | + python setup.py build_ext |
| 61 | + python setup.py egg_info |
| 62 | + python setup.py bdist_wheel |
| 63 | + # TODO This doesn't seem to be installing, fails on bdist_wheel build. |
| 64 | + # pip install dist/*.tar.gz |
| 65 | + # - run: |
| 66 | + # name: Compile C |
| 67 | + # command: | |
| 68 | + # CFLAGS=--coverage meson c/ build-gcc && cd build-gcc && ninja |
| 69 | + # - run: |
| 70 | + # name: Run C tests |
| 71 | + # command: | |
| 72 | + # export KASTORE_SOPATH=./build-gcc/libtskit.so |
| 73 | + # ./build-gcc/tests |
| 74 | + # ./build-gcc/dynamic_api_tests |
| 75 | + # ./build-gcc/malloc_tests |
| 76 | + # ./build-gcc/io_tests |
| 77 | + # - run: |
| 78 | + # name: Valgrind for C tests. |
| 79 | + # command: | |
| 80 | + # export KASTORE_SOPATH=./build-gcc/libtskit.so |
| 81 | + # valgrind --leak-check=full --error-exitcode=1 ./build-gcc/tests |
| 82 | + # valgrind --leak-check=full --error-exitcode=1 ./build-gcc/dynamic_api_tests |
| 83 | + # valgrind --leak-check=full --error-exitcode=1 ./build-gcc/malloc_tests |
| 84 | + # valgrind --leak-check=full --error-exitcode=1 ./build-gcc/io_tests |
| 85 | + # - run: |
| 86 | + # name: Run gcov & upload coverage. |
| 87 | + # command: | |
| 88 | + # gcov -pb -o ./python/build/temp.linux*/ python/_tskitmodule.c |
| 89 | + # gcov -pb ./build-gcc/tests@exe/tskit.c.gcno \ |
| 90 | + # ./build-gcc/malloc_tests@exe/tskit.c.gcno \ |
| 91 | + # ./build-gcc/io_tests@exe/tskit.c.gcno \ |
| 92 | + # ./build-gcc/dynamic_api_tests@exe/tskit.c.gcno \ |
| 93 | + # ./build-gcc/tskit@sha/tskit.c.gcno |
| 94 | + # codecov -X gcov -F C |
| 95 | + # - run: |
| 96 | + # name: Compile C tests under clang |
| 97 | + # command: | |
| 98 | + # CC=clang meson c/ build-clang && cd build-clang && ninja |
| 99 | + # - run: |
| 100 | + # name: Run clang C tests |
| 101 | + # command: | |
| 102 | + # export KASTORE_SOPATH=./build-clang/libtskit.so |
| 103 | + # ./build-clang/tests |
| 104 | + # ./build-clang/dynamic_api_tests |
| 105 | + # ./build-clang/malloc_tests |
| 106 | + # ./build-clang/io_tests |
| 107 | + |
| 108 | + # - run: |
| 109 | + # name: Build docs |
| 110 | + # command: | |
| 111 | + # cd docs && make |
0 commit comments