Merge branch 'master' of github.com:lskatz/SneakerNet #355
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ] | |
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@v2 | |
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: chown /usr/share/miniconda | |
# run: | | |
# # In order to cache this directory for myself | |
# # downstream, I need to own it | |
# sudo find /usr/share/miniconda -exec chown -v $(whoami) {} \; | |
- name: Cache Conda env | |
id: cache-conda | |
uses: actions/cache@v3 | |
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: 5 | |
- 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-moo perl-list-moreutils kma=1.4 | |
- 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 "$GITHUB_WORKSPACE/shovill/bin" >> $GITHUB_PATH | |
#echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH | |
#echo "$GITHUB_WORKSPACE/krona" >> $GITHUB_PATH | |
#echo "$GITHUB_WORKSPACE/SPAdes-${spadesVer}-Linux/bin" >> $GITHUB_PATH | |
#echo "$GITHUB_WORKSPACE/kmc" >> $GITHUB_PATH | |
#echo "$GITHUB_WORKSPACE/Lighter-1.1.1" >> $GITHUB_PATH | |
echo | |
cat $GITHUB_PATH | |
- name: checkout my repo | |
uses: actions/checkout@v2 | |
with: | |
path: SneakerNet | |
- name: checkout CG-Pipeline | |
uses: actions/checkout@v2 | |
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 | |
#- name: Cache Kraken DB | |
# id: cache-kraken | |
# uses: actions/cache@v3 | |
# with: | |
# path: /kraken-database | |
# key: conda-${{ 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 | |
# shell: bash -el {0} | |
# if: steps.cache-kraken.outputs.cache-hit != 'true' | |
# run: | | |
# sudo mkdir -v $KRAKEN_DEFAULT_DB | |
# sudo chown -v $USER $KRAKEN_DEFAULT_DB | |
# chmod -v 775 $KRAKEN_DEFAULT_DB | |
# gunzip -v $GITHUB_WORKSPACE/SneakerNet/t/asm/*.fasta.gz | |
# find $GITHUB_WORKSPACE/SneakerNet/t/asm -name '*.fasta' -exec kraken-build --db $KRAKEN_DEFAULT_DB --add-to-library {} \; | |
# mkdir $KRAKEN_DEFAULT_DB/taxonomy --work-on-disk | |
# cp -v $GITHUB_WORKSPACE/SneakerNet/t/asm/*.dmp.gz $KRAKEN_DEFAULT_DB/taxonomy | |
# gunzip -v $KRAKEN_DEFAULT_DB/taxonomy/*.gz | |
# kraken-build --db $KRAKEN_DEFAULT_DB --threads 1 --build --work-on-disk | |
- 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: | | |
#eval $(perl -I $HOME/perl5/lib/perl5/ -Mlocal::lib) | |
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 | |
#prove -lv t | |
make | |
make test | |