pinning numpy<2 #390
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: CI | |
on: | |
push: | |
branches: [ master, develop ] | |
pull_request: | |
branches: [ master, develop ] | |
jobs: | |
run_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: [3.8, 3.9, 3.10, 3.11, 3.12] | |
fail-fast: false | |
steps: | |
- name: Install system depedencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libbz2-dev liblzma-dev | |
if: ${{ runner.os == 'Linux' }} | |
- uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Upgrade setuptools | |
run: | | |
pip3 install wheel --upgrade | |
pip3 install setuptools --upgrade | |
- name: Install Gurobi | |
run: | | |
wget https://packages.gurobi.com/9.0/gurobi9.0.2_linux64.tar.gz -O gurobi9.0.2_linux64.tar.gz | |
tar xvzf gurobi9.0.2_linux64.tar.gz | |
(cd gurobi902/linux64/src/build && make) | |
(cd gurobi902/linux64/lib && ln -f -s ../src/build/libgurobi_c++.a libgurobi_c++.a) | |
echo "GUROBI_HOME=$(realpath gurobi902)" >> $GITHUB_ENV | |
- name: Activate Gurobi License | |
run: | | |
(cd gurobi902/linux64/bin && ./grbgetkey -q ${{ secrets.GUROBI_KEYCODE }} --path ${GUROBI_HOME}) | |
echo "GRB_LICENSE_FILE=${GUROBI_HOME}/gurobi.lic" >> $GITHUB_ENV | |
continue-on-error: true | |
- name: Install HATCHet with dev dependencies | |
run: | | |
python -m pip install .[dev] | |
env: | |
CXXFLAGS: -pthread | |
- name: Pre-commit checks | |
run: | | |
pre-commit run --all-files | |
- name: Download Testing Data | |
run: | | |
pip3 install zenodo-get | |
python3 -m zenodo_get 10.5281/zenodo.4046906 --output-dir=testdata | |
echo "HATCHET_TESTS_BAM_DIRECTORY=$(realpath testdata)" >> $GITHUB_ENV | |
- name: Install coinor-cbc | |
run: | | |
sudo apt install coinor-cbc | |
echo "HATCHET_COMPUTE_CN_SOLVER=cbc" >> $GITHUB_ENV | |
- name: Install SAMtools | |
run: | | |
wget https://sourceforge.net/projects/samtools/files/samtools/1.7/samtools-1.7.tar.bz2/download -O samtools-1.7.tar.bz2 | |
tar xvjf samtools-1.7.tar.bz2 | |
(cd samtools-1.7 && ./configure && make) | |
echo "HATCHET_PATHS_SAMTOOLS=$(realpath samtools-1.7)" >> $GITHUB_ENV | |
- name: Install BCFTools | |
run: | | |
wget https://sourceforge.net/projects/samtools/files/samtools/1.7/bcftools-1.7.tar.bz2/download -O bcftools-1.7.tar.bz2 | |
tar xvjf bcftools-1.7.tar.bz2 | |
(cd bcftools-1.7 && ./configure && make) | |
echo "HATCHET_PATHS_BCFTOOLS=$(realpath bcftools-1.7)" >> $GITHUB_ENV | |
- name: Install tabix | |
run: | | |
wget https://sourceforge.net/projects/samtools/files/tabix/tabix-0.2.6.tar.bz2/download -O tabix-0.2.6.tar.bz2 | |
bzip2 -d tabix-0.2.6.tar.bz2 | |
tar -xvf tabix-0.2.6.tar | |
(cd tabix-0.2.6 && make) | |
echo "HATCHET_PATHS_TABIX=$(realpath tabix-0.2.6)" >> $GITHUB_ENV | |
echo "HATCHET_PATHS_BGZIP=$(realpath tabix-0.2.6)" >> $GITHUB_ENV | |
- name: Install mosdepth | |
run: | | |
wget https://github.com/brentp/mosdepth/releases/download/v0.3.2/mosdepth -O mosdepth | |
chmod 775 mosdepth | |
echo "HATCHET_PATHS_MOSDEPTH=$(pwd)" >> $GITHUB_ENV | |
- name: Install picard | |
run: | | |
wget https://github.com/broadinstitute/picard/releases/download/2.26.2/picard.jar -O picard.jar | |
echo "HATCHET_PATHS_PICARD=$(pwd)" >> $GITHUB_ENV | |
- name: Install shapeit2 | |
run: | | |
wget https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.v2.r904.glibcv2.17.linux.tar.gz -O shapeit.v2.r904.glibcv2.17.linux.tar.gz | |
tar -xf shapeit.v2.r904.glibcv2.17.linux.tar.gz | |
echo "HATCHET_PATHS_SHAPEIT=$(realpath shapeit.v2.904.3.10.0-693.11.6.el7.x86_64/bin)" >> $GITHUB_ENV | |
- name: Install bedtools | |
run: | | |
wget https://github.com/arq5x/bedtools2/releases/download/v2.30.0/bedtools.static.binary -O bedtools | |
chmod 775 bedtools | |
echo "$(pwd)" >> $GITHUB_PATH | |
- name: Download and index hg19.fa | |
working-directory: testdata | |
run: | | |
wget https://hgdownload.soe.ucsc.edu/goldenPath/hg19/bigZips/hg19.fa.gz | |
gunzip hg19.fa.gz | |
$HATCHET_PATHS_SAMTOOLS/samtools faidx hg19.fa | |
$HATCHET_PATHS_SAMTOOLS/samtools dict hg19.fa > hg19.dict | |
echo "HATCHET_PATHS_REFERENCE=$(realpath hg19.fa)" >> $GITHUB_ENV | |
# Instead of downloading the entire 1000GP_Phase3 panel (huge) using | |
# wget https://mathgen.stats.ox.ac.uk/impute/1000GP_Phase3.tgz | |
# we download equivalent data only for chr22, from zenodo | |
- name: Download 1000GP reference panel | |
working-directory: testdata | |
run: | | |
python3 -m zenodo_get 10.5281/zenodo.6709541 | |
tar zxvf 1000GP_Phase3.tgz --wildcards *chr22* *sample | |
echo "HATCHET_DOWNLOAD_PANEL_REFPANELDIR=$(pwd)" >> $GITHUB_ENV | |
- name: HATCHet Check | |
run: | | |
hatchet check | |
- name: Pytest | |
run: | | |
pytest tests --cov=hatchet | |
# We may end up with files that have a ':' in their filenames, | |
# due to the <chr>:start:end notation of chromosomes we process through SAMtools/BCFtools. | |
# upload-artifact is unable to handle these, so we replace colons with dashes | |
- name: Clean up artifact filenames | |
run: | | |
sudo apt install rename | |
find tests/out -name "*:*" -exec rename 's|:|-|g' {} \; | |
- name: Save Pytest Output Data | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results-${{ matrix.python }} | |
path: tests/out | |
- name: Convert coverage | |
run: | | |
python -m coverage xml | |
continue-on-error: true | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
fail_ci_if_error: false | |
build_docs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Upgrade setuptools | |
run: | | |
pip3 install wheel --upgrade | |
pip3 install setuptools --upgrade | |
- name: Install Gurobi | |
run: | | |
wget https://packages.gurobi.com/9.0/gurobi9.0.2_linux64.tar.gz -O gurobi9.0.2_linux64.tar.gz | |
tar xvzf gurobi9.0.2_linux64.tar.gz | |
(cd gurobi902/linux64/src/build && make) | |
(cd gurobi902/linux64/lib && ln -f -s ../src/build/libgurobi_c++.a libgurobi_c++.a) | |
echo "GUROBI_HOME=$(realpath gurobi902)" >> $GITHUB_ENV | |
- name: Install package | |
run: | | |
CXXFLAGS=-pthread pip install .[dev] | |
- name: Build docs | |
run: | | |
cd docs && sphinx-apidoc -f -o ./source/src ../src/hatchet -H Modules && make html && touch build/html/.nojekyll | |
- name: Update gh-pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: "docs/buildDocs.sh" | |
shell: bash |