-
Notifications
You must be signed in to change notification settings - Fork 18
121 lines (121 loc) · 5.13 KB
/
python-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# 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: Mikado
on:
[ push, pull_request ]
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: [ "3.9", "3.10" ]
# solver: ["classic", "libmamba"]
os: [ubuntu-latest, macos-latest]
# os: [ubuntu-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@v2
env:
CACHE_NUMBER: 1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('./environment.yml') }}
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
id: setup-miniconda
continue-on-error: true
with:
python-version: "3.10"
mamba-version: "*"
# channels: conda-forge, defaults
channels: conda-forge, bioconda, defaults, anaconda
channel-priority: true
activate-environment: "mikado2"
environment-file: ./environment.yml
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Verify conda environment
run: |
conda info --envs
- name: Install dependencies
run: |
source activate mikado2
python --version
gcc --version
pip --version
pip install -r requirements.txt
python -c "import pysam; print(pysam.__version__)"
pip install Cython pytest-cov
python setup.py develop
- name: Test light
run: |
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 -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!=2021.02.22" \
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: |
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 --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