-
Notifications
You must be signed in to change notification settings - Fork 4
204 lines (200 loc) · 7.04 KB
/
unittests.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: unit-tests
on: [push]
env:
spadesVer: 3.14.1
KRAKEN_DEFAULT_DB: /kraken-database
# perl: [ '5.32', '5.30', '5.28' ]
# perl: [ '5.32', '5.30.1', '5.16.3', '5.12.3' ]
# os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
# https://github.com/marketplace/actions/setup-perl-environment
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04' ]
perl: [ '5.36.0' ]
python-version: ['3.10']
defaults:
run:
shell: bash -el {0}
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- name: Get Date
id: get-date
run: |
today=$(/bin/date -u '+%Y%m%d')
echo $today
echo "today=$today" >> $GITHUB_OUTPUT
- name: set up conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
use-mamba: true
miniforge-variant: Mambaforge
miniforge-version: latest
channel-priority: strict
channels: conda-forge,bioconda,defaults
mamba-version: "*"
auto-activate-base: true
activate-environment: "~/conda_pkgs_dir/my-env"
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: conda info
run: |
conda info
echo
conda list
echo
conda config --show
- name: Cache Conda env
id: cache-conda
uses: actions/cache@v4
with:
path: |
~/conda_pkgs_dir
~/.conda
~/.condarc
#/usr/share/miniconda
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-perl_v${{ matrix.perl }}--${{env.CACHE_NUMBER}}
env:
CACHE_NUMBER: 1
- name: conda installations
shell: bash -el {0}
if: steps.cache-conda.outputs.cache-hit != 'true'
run: |
mamba install -y perl shovill krona samclip flash mash seqtk \
kmc lighter megahit pilon trimmomatic perl-bioperl kraken=1 \
spades skesa=2.4 python=3.7 perl-cg-pipeline perl-gd blast prodigal \
perl-app-cpanminus perl-statistics-descriptive perl-config-simple \
perl-file-slurp perl-text-levenshtein perl-moo perl-list-moreutils kma=1.4 \
multiqc fastqc bowtie2 perl-gd perl-gdgraph salmid staramr kalamari taxonkit
- name: check installation
shell: bash -el {0}
run: |
perl -v
echo
python -V
echo
which perl
which python
echo
which kraken
kraken --version
which kraken-build
echo
echo conda
conda info
echo
ls -l ~/conda_pkgs_dir /usr/share/miniconda || true
- name: add some paths to PATH
run: |
echo "$GITHUB_WORKSPACE/CG-Pipeline/scripts" >> $GITHUB_PATH
echo
cat $GITHUB_PATH
- name: checkout my repo
uses: actions/checkout@v4
with:
path: SneakerNet
- name: checkout CG-Pipeline
uses: actions/checkout@v4
with:
repository: lskatz/CG-Pipeline
path: CG-Pipeline
ref: v0.5
- name: apt-get install
run: |
sudo apt-get update
sudo apt-get -y install ca-certificates
sudo apt-get -y install build-essential sendmail tree
- name: Cache Kraken DB
id: cache-kraken
uses: actions/cache@v4
with:
path: |
/home/runner/conda_pkgs_dir/my-env/share/kalamari-*
key: kraken-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-perl_v${{ matrix.perl }}--${{env.CACHE_NUMBER}}
env:
CACHE_NUMBER: 0
- name: make very simple kraken database
if: false
#if: steps.cache-kraken.outputs.cache-hit != 'true'
shell: bash -el {0}
run: |
which downloadKalamari.sh
KALAMARI_DEBUG=1 downloadKalamari.sh
echo "Running buildTaxonomy.sh"
buildTaxonomy.sh
echo
tree $(dirname $(which downloadKalamari.sh))/../share/kalamari-*
echo
echo "Running filterTaxonomy.sh"
bash -x filterTaxonomy.sh
echo
tree $(dirname $(which downloadKalamari.sh))/../share/kalamari-*
echo
buildKraken1.sh || echo "ERROR building Kraken1 database with exit code $?"
- name: Dumper INC
shell: bash -el {0}
run: perl -MData::Dumper -e 'print Dumper \@INC'
- name: tree pwd
run: tree $(pwd)
- name: tree home
run: tree $HOME
- name: tree GITHUB_WORKSPACE
run: tree $GITHUB_WORKSPACE
- name: tree -L 3 -d GITHUB_WORKSPACE
run: tree -L 3 -d $GITHUB_WORKSPACE
- name: env
shell: bash -el {0}
run: env
- name: perl-check-dependencies
shell: bash -el {0}
run: |
cd $GITHUB_WORKSPACE/SneakerNet
perl Makefile.PL
make
#cpanm --installdeps . -l $HOME/perl5 --verbose --notest --force
#perl -MData::Dumper -MStatistics::Descriptive -MConfig::Simple -MFile::Slurp -MBio::Kmer -MBio::SeqIO -MText::Fuzzy -MEmail::Stuffer -MBio::FeatureIO -MMoo -MList::MoreUtils -MJSON -e 'print Dumper \%INC'
make
echo "DEBUG: PERL5LIB: $PERL5LIB"
- name: check-SneakerNet-repo
shell: bash -el {0}
run: |
#eval $(perl -I $HOME/perl5/lib/perl5/ -Mlocal::lib)
cd $GITHUB_WORKSPACE/SneakerNet
cat MYMETA.json
echo;env;echo
ls -lhS t/M00123-18-001-test/
md5sum t/M00123-18-001-test/*.fastq.gz
for i in t/M00123-18-001-test/*.fastq.gz; do echo -ne "$i\t"; zcat $i | tail -n 1; done;
echo
echo "PATH broken up:"
echo "$PATH" | tr ":" "\n"
echo
echo "GITHUB_ENV: $GITHUB_ENV"
cat $GITHUB_ENV
echo "GITHUB_PATH: $GITHUB_PATH"
cat $GITHUB_PATH
echo "Which flash:"
which flash
echo
echo "Running t/00_env.t ..."
perl t/00_env.t
for i in t/M00123-18-001-test/*.fastq.gz; do echo -ne "$i\t"; zcat $i | tail -n 1; done;
- id: prove-lv-t
name: prove-lv-t
shell: bash -el {0}
run: |
mkdir -v $GITHUB_WORKSPACE/tmp
export TMPDIR=$GITHUB_WORKSPACE/tmp
cd $GITHUB_WORKSPACE/SneakerNet
#sed -i 's+/opt/kraken/full-20140723+/kraken-database+g' config/settings.conf
sed -i '/KRAKEN_DEFAULT_DB/d' config/settings.conf
condabin=$(dirname $(which downloadKalamari.sh))
kalamari_ver=$(downloadKalamari.pl --version)
kraken_dir="$condabin/../share/kalamari-$kalamari_ver/kalamari-kraken"
echo $kraken_dir
ls -lh $kraken_dir || echo "ERROR: could not ls $kraken_dir"
echo "KRAKEN_DEFAULT_DB $kraken_dir" >> config/settings.conf
make
make test