174 lines (151 loc) · 7.03 KB
/
tests_weekly.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: weekly tests
on:
schedule:
# every Sunday at 0:00
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: "0 0 * * 0"
env:
cache-version: "cache-v1"
jobs:
tests:
timeout-minutes: 720
defaults:
run:
shell: bash -l {0}
strategy:
max-parallel: 10
matrix:
config:
- { python-version: 3.9, os: ubuntu-latest }
- { python-version: "3.10", os: ubuntu-latest }
- { python-version: "3.11", os: ubuntu-latest }
- { python-version: 3.9, os: macos-latest }
- { python-version: "3.10", os: macos-latest }
- { python-version: "3.11", os: macos-latest }
# disabled until it's fixed.
runs-on: ${{ matrix.config.os }}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
NOT_CRAN: true
TZ: UTC
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install ubuntu system dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get install libcurl4-openssl-dev
sudo apt-get update -y && sudo apt-get install -y zlib1g-dev libglpk-dev libgmp3-dev libxml2-dev libicu-dev libhdf5-serial-dev libcurl4-gnutls-dev
- name: Install macOS system dependencies
if: matrix.config.os == 'macos-latest'
run: |
brew install cairo pkg-config autoconf automake libtool
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('environment.yml') }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
auto-update-conda: true
activate-environment: dandelion
channels: conda-forge, bioconda, anaconda, defaults
channel-priority: true
python-version: ${{ matrix.config.python-version }}
environment-file: environment.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Display Python version
run: |
python --version
which python
- name: Setup blast and igblast
# just in case this happens again in the future
# conda install -c bioconda igblast blast ncbi-vdb=2.11.0
# https://github.com/bioconda/bioconda-recipes/issues/33479
run: |
conda install -c bioconda "igblast>=1.17.0" blast
- name: Test if blast works
run: |
blastn -h
- name: Test if igblast works
run: |
igblastn -h
- id: R
name: Check R version
run: |
R --version > VERSION
echo "version=$(head -1 VERSION | awk '{print $3}')" >> $GITHUB_OUTPUT
echo "mainbiocversion=$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')" >> $GITHUB_OUTPUT
echo "subbiocversion=$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $2}')" >> $GITHUB_OUTPUT
echo "biocversion=$(Rscript -e 'cat(as.character(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')" >> $GITHUB_OUTPUT
shell: bash -l {0}
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ steps.R.outputs.version}}
- name: Cache ubuntu R packages
if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os == 'ubuntu-latest'"
uses: actions/cache@v3
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-
- name: Cache macOS R packages
if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os != 'ubuntu-latest'"
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-
- name: Setup r-lib/remotes
run: |
options(install.packages.compile.from.source = "never")
install.packages(c('remotes', 'optparse', 'RCurl', 'XML','matrixStats', 'stringi'))
shell: Rscript {0}
- name: Install Dandelion
run: |
python -m pip install git+https://github.com/emdann/milopy.git
python -m pip install palantir
python -m pip install ".[scirpy]"
- name: Install ubuntu R dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
options(install.packages.compile.from.source = "never")
remotes::install_cran("BiocManager")
BiocManager::install(c('Biostrings', 'GenomicAlignments', 'IRanges'))
install.packages(c('shazam', 'alakazam', 'tigger', 'optparse'))
shell: Rscript {0}
- name: Install macOS R dependencies
if: matrix.config.os != 'ubuntu-latest'
run: |
options(install.packages.compile.from.source = "never")
remotes::install_cran("BiocManager")
BiocManager::install(c('Biostrings', 'GenomicAlignments', 'IRanges'))
install.packages(c('shazam', 'alakazam', 'tigger', 'optparse'))
shell: Rscript {0}
- name: Test if R dependencies are installed properly
run: |
Rscript tests/r_dependencies.R
shell: bash -l {0}
- name: Test with pytest
run: |
python -m pytest --cov=dandelion --cov-report=xml --ignore=container -rP -W ignore::DeprecationWarning -W ignore::PendingDeprecationWarning -W ignore::FutureWarning
- name: Show coverage
run: |
coverage report