Skip to content

Update docs deps

Update docs deps #1253

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches: [main]
jobs:
pre-commit:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: install clang-format
if: steps.clang_format.outputs.cache-hit != 'true'
run: |
sudo pip install clang-format==6.0.1
sudo ln -s /usr/local/bin/clang-format /usr/local/bin/clang-format-6.0
- uses: pre-commit/[email protected]
test:
name: Python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: [ 3.8, "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@v3
with:
submodules: true
- name: Cache conda and dependancies
id: cache
uses: actions/cache@v3
with:
path: |
c:\Miniconda\envs\anaconda-client-env
/usr/share/miniconda/envs/anaconda-client-env
~/osx-conda
~/.profile
key: ${{ runner.os }}-${{ matrix.python}}-conda-v14-${{ hashFiles('requirements/CI-tests-conda/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 .profile
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
run: |
cp ~/.bash_profile ~/.profile
# Work around weird issues on OSX possibly caused by mixed compilers
# https://github.com/tskit-dev/tsinfer/issues/376
- name: Install compiler from conda
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0} #We need a login shell to get conda
run: conda install --yes c-compiler
- 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=requirements/CI-tests-conda/requirements.txt
- name: Install cyvcf2 #Fails if done via conda due to no windows support.
if: steps.cache.outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
run: |
source ~/.profile
conda activate anaconda-client-env
pip install cyvcf2==0.30.18
- 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
run: |
source ~/.profile
conda activate anaconda-client-env
python setup.py build_ext --inplace
- name: Run tests
run: |
source ~/.profile
conda activate anaconda-client-env
python -m pytest -xv