Skip to content

Commit

Permalink
Issue 392 (#393)
Browse files Browse the repository at this point in the history
* Fix tests on osx

* Changing the GHA to use the cache for PIP and Conda

* Disabling the full daijin_assemble run on the OSX tests as Portcullis is not (yet) available for it on Conda.

* Properly fix #392, with attending tests

* Fixed the log crash detected on OSX by @ljyanesm

Co-authored-by: ljyanesm <yanes.luis@gmail.com>
  • Loading branch information
lucventurini and ljyanesm authored Mar 24, 2021
1 parent 40f887b commit 69e45a4
Show file tree
Hide file tree
Showing 40 changed files with 49,481 additions and 250 deletions.
86 changes: 60 additions & 26 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,46 @@ on:
[ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: [ 3.8, 3.7, 3.6 ]
os: [ubuntu-latest, macos-latest]
steps:
- name: Install system development tools
if: startsWith(runner.os, 'Linux')
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install -y build-essential zlib1g-dev zlib1g
- uses: actions/checkout@v2
- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache conda
id: cache-miniconda
uses: actions/cache@v1
uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ hashFiles('./environment.yml') }}
- name: Install system development tools
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install -y build-essential zlib1g-dev zlib1g
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('./environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -37,41 +53,59 @@ jobs:
environment-file: ./environment.yml
mamba-version: "*"
use-mamba: true
channels: bioconda, conda-forge, defaults
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
auto-update-conda: true
activate-environment: "test"
auto-activate-base: false
channels: conda-forge, defaults
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
# auto-update-conda: false
activate-environment: "mikado2"
# auto-activate-base: false
- name: Install dependencies
run: |
mamba install -y -c conda-forge -n test -- pytest-cov
gcc --help
mamba install -n test -c bioconda -c conda-forge -y bioconda::portcullis stringtie scallop gmap star hisat2 prodigal blast diamond transdecoder conda-forge::gnuplot kallisto samtools gffread
pip install -r requirements.txt
pip install Cython
pip install Cython pytest-cov
python setup.py develop
- name: Test light
run: |
pytest -m slow Mikado/tests/test_system_calls.py::SerialiseChecker::test_subprocess_multi_empty_orfs
- name: Test full
pytest -m slow Mikado/tests/test_light.py::LightTest::test_subprocess_multi_empty_orfs
- name: Test full with coverage
if: startsWith(runner.os, 'Linux')
run: |
pytest --cov=Mikado --cov-report=xml --cov-config=.coveragerc -m 'not triage';
- name: Test full without coverage
if: startsWith(runner.os, 'macOS')
run: |
pytest --cov=Mikado --cov-report=xml --cov-config=.coveragerc -m '(slow or not slow) and not triage';
pytest -m 'not triage';
- name: Upload coverage to Codecov
if: startsWith(runner.os, 'Linux')
uses: codecov/codecov-action@v1
- name: Test daijin
if: startsWith(runner.os, 'Linux')
run: |
mamba install -c bioconda -c conda-forge -y bioconda::portcullis stringtie scallop gmap \
star hisat2 prodigal blast diamond transdecoder conda-forge::gnuplot kallisto samtools gffread;
cd sample_data; snakemake --latency-wait 60 --jobs 5 --cores 5
- name: Test daijin mikado
if: startsWith(runner.os, 'macOS')
run: |
cd sample_data; snakemake --jobs 5 --cores 5
mamba install -c bioconda -c conda-forge -y prodigal blast diamond transdecoder kallisto samtools gffread;
cd sample_data; snakemake --latency-wait 60 --jobs 5 --cores 5 complete_no_assemble
- name: Test fast
run: |
python -c "import Mikado; Mikado.test(label='fast')";
- name: Test seed
run: |
# Check that the seed is set properly
mikado serialise --junctions sample_data/junctions.bed --genome Mikado/tests/chr5.fas.gz --transcripts Mikado/tests/check_seed.fa --configuration Mikado/tests/check_seed.yaml
mikado pick --log $(pwd)/pick.20a.log --procs 2 --seed 20 --fasta Mikado/tests/chr5.fas.gz --json-conf Mikado/tests/check_seed.yaml -od 20a Mikado/tests/check_seed.gtf
mikado pick --log $(pwd)/pick.20b.log --procs 2 --seed 20 --fasta Mikado/tests/chr5.fas.gz --json-conf Mikado/tests/check_seed.yaml -od 20b Mikado/tests/check_seed.gtf
mikado pick --log $(pwd)/pick.20c.log --procs 2 --seed 20 --fasta Mikado/tests/chr5.fas.gz --json-conf Mikado/tests/check_seed.yaml -od 20c Mikado/tests/check_seed.gtf
mikado pick --log $(pwd)/pick.20d.log --procs 2 --seed 20 --fasta Mikado/tests/chr5.fas.gz --json-conf Mikado/tests/check_seed.yaml -od 20d Mikado/tests/check_seed.gtf
mikado pick --log $(pwd)/pick.10.log --procs 2 --seed 1000 --fasta Mikado/tests/chr5.fas.gz --json-conf Mikado/tests/check_seed.yaml -od 1000 Mikado/tests/check_seed.gtf
mikado serialise --junctions sample_data/junctions.bed --genome Mikado/tests/chr5.fas.gz \
--transcripts Mikado/tests/check_seed.fa --configuration Mikado/tests/check_seed.yaml;
mikado pick --log $(pwd)/pick.20a.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--configuration Mikado/tests/check_seed.yaml -od 20a Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.20b.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--configuration Mikado/tests/check_seed.yaml -od 20b Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.20c.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--json-conf Mikado/tests/check_seed.yaml -od 20c Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.20d.log --procs 2 --seed 20 --genome Mikado/tests/chr5.fas.gz \
--json-conf Mikado/tests/check_seed.yaml -od 20d Mikado/tests/check_seed.gtf;
mikado pick --log $(pwd)/pick.10.log --procs 2 --seed 1000 --genome Mikado/tests/chr5.fas.gz \
--json-conf Mikado/tests/check_seed.yaml -od 1000 Mikado/tests/check_seed.gtf;
if [[ $(diff -q 20a 20b) || $(diff -q 20a 20c) || $(diff -q 20a 20d) ]]; then exit 1; fi
if [[ ! $(diff -q 20a 1000) ]]; then exit 1; fi
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version 2.2.3

Testing Mikado also on OSX, and adding OSX to the supported OSes in Conda.
Fix [#392](https://github.com/EI-CoreBioinformatics/mikado/issues/392):

# Version 2.2.2

Added the SHM capabilities to `mikado serialise` and `mikado compare`.
Expand Down
Loading

0 comments on commit 69e45a4

Please sign in to comment.