Skip to content

Merge pull request #351 from bcgsc/release/v3.1.1 #430

Merge pull request #351 from bcgsc/release/v3.1.1

Merge pull request #351 from bcgsc/release/v3.1.1 #430

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches:
- master
- develop
pull_request:
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
name: python-${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: install machine dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -e .[test] # need editable to make sure the coverage reports correctly
- name: install bwa
run: |
git clone https://github.com/lh3/bwa.git
cd bwa
git checkout v0.7.17
make
cd ..
- name: install blat
run: |
wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/blat/blat
chmod a+x blat
- name: set up .pth file
run: |
python tests/setup_subprocess_cov.py
- name: run full tests with pytest
run: |
export PATH=$PATH:$(pwd):$(pwd)/bwa
export COVERAGE_PROCESS_START=$(pwd)/.coveragerc
pytest tests -v \
--junitxml=junit/test-results-${{ matrix.python-version }}.xml \
--cov mavis \
--cov tools.convert_annotations_format \
--cov-report term-missing \
--cov-report xml \
--durations=10 \
--cov-branch
env:
RUN_FULL: 1
- name: Upload pytest test results
uses: actions/upload-artifact@master
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: always()
- name: Update code coverage report to CodeCov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
if: matrix.python-version == 3.8
docker:
runs-on: ubuntu-latest
name: docker build
steps:
- uses: actions/checkout@v2
- name: build the docker container
run: |
docker build --file Dockerfile --tag bcgsc/mavis:latest .
- name: test the help menu
run: |
docker run bcgsc/mavis -h
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install workflow dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install mavis_config pandas
- uses: eWaterCycle/setup-singularity@v6
with:
singularity-version: 3.6.4
- name: docker2singularity
run:
docker run --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock --mount type=bind,source="$(pwd)",target=/output --privileged -t --rm singularityware/docker2singularity bcgsc/mavis:latest
- name: Run analysis with snakemake & singularity
run: |
# get the SIMG filename
export SNAKEMAKE_CONTAINER=$(ls *mavis*.simg)
snakemake -j 2 --configfile tests/mini-tutorial.config.json --use-singularity
if: always()