Tests and documentation for genetic_relatedness_weighted #4830
Workflow file for this run
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
name: Tests | |
on: | |
pull_request: | |
push: | |
branches: [main, test] | |
jobs: | |
pre-commit: | |
name: Lint | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- name: install clang-format | |
if: steps.clang_format.outputs.cache-hit != 'true' | |
run: | | |
sudo apt-get remove -y clang-6.0 libclang-common-6.0-dev libclang1-6.0 libllvm6.0 | |
sudo apt-get autoremove | |
sudo apt-get install clang-format clang-format-6.0 | |
- uses: pre-commit/[email protected] | |
test: | |
name: Python | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [ 3.7, 3.9, "3.10" ] | |
os: [ macos-latest, ubuntu-latest, windows-latest ] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache conda and dependencies | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
c:\Miniconda\envs\anaconda-client-env | |
/usr/share/miniconda/envs/anaconda-client-env | |
~/osx-conda | |
~/.profile | |
key: ${{ runner.os }}-${{ matrix.python}}-conda-v11-${{ hashFiles('python/requirements/CI-tests-conda/requirements.txt') }}-${{ hashFiles('python/requirements/CI-tests-pip/requirements.txt') }} | |
- name: Install Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
activate-environment: anaconda-client-env | |
python-version: ${{ matrix.python }} | |
channels: conda-forge | |
channel-priority: strict | |
auto-update-conda: true | |
use-only-tar-bz2: true | |
- name: Fix windows symlinks | |
working-directory: python | |
if: matrix.os == 'windows-latest' | |
run: | | |
rm -r lib | |
mkdir lib | |
cp -r --dereference ../c/subprojects lib/. | |
cp -r --dereference ../c/tskit lib/. | |
cp ../c/tskit.h lib/. | |
- name: Fix windows .profile | |
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' | |
run: | | |
cp ~/.bash_profile ~/.profile | |
- name: Install conda deps | |
if: steps.cache.outputs.cache-hit != 'true' | |
shell: bash -l {0} #We need a login shell to get conda | |
run: | | |
conda install --yes --file=python/requirements/CI-tests-conda/requirements.txt | |
- name: Install pip deps | |
if: steps.cache.outputs.cache-hit != 'true' | |
shell: bash -l {0} | |
run: | | |
pip install setuptools==57.5.0 #v58 broke some deps https://setuptools.pypa.io/en/latest/history.html#v58-0-0 | |
pip install -r python/requirements/CI-tests-pip/requirements.txt | |
- name: Fix OSX Cache Write #OSX Won't let the cache restore due to file perms | |
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' | |
run: | | |
cp -r /usr/local/miniconda/envs/anaconda-client-env ~/osx-conda | |
- name: Fix OSX Cache Restore | |
if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest' | |
run: | | |
mkdir -p /usr/local/miniconda/envs | |
sudo cp -r ~/osx-conda /usr/local/miniconda/envs/anaconda-client-env | |
- name: Build module | |
working-directory: python | |
run: | | |
source ~/.profile | |
conda activate anaconda-client-env | |
python setup.py build_ext --inplace | |
- name: Run tests | |
working-directory: python | |
run: | | |
source ~/.profile | |
conda activate anaconda-client-env | |
# pytest -xv -n2 | |
python -m pytest -x --cov=tskit --cov-report=xml --cov-branch -n2 tests | |
- name: Upload coverage to Codecov | |
if: matrix.os == 'ubuntu-latest' | |
uses: codecov/codecov-action@v2 | |
with: | |
working-directory: python | |
fail_ci_if_error: true | |
flags: python-tests | |
name: codecov-umbrella | |
verbose: true | |
msys2: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
include: | |
- { sys: mingw32, env: i686 } | |
- { sys: mingw64, env: x86_64 } | |
name: Windows (${{ matrix.sys }}, ${{ matrix.env }}) | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: 'Checkout' | |
uses: actions/checkout@v2 | |
- name: Setup MSYS2 ${{matrix.sys}} | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{matrix.sys}} | |
update: true | |
install: >- | |
git | |
mingw-w64-${{matrix.env}}-toolchain | |
mingw-w64-${{matrix.env}}-ninja | |
mingw-w64-${{matrix.env}}-meson | |
mingw-w64-${{matrix.env}}-cunit | |
- name: Build | |
working-directory: c | |
run: | | |
meson build -Dbuild_examples=false | |
ninja -C build | |
- name: Run tests | |
working-directory: c | |
run: | | |
ninja -C build test |