Skip to content

Commit

Permalink
Unit testing (#77)
Browse files Browse the repository at this point in the history
* trying unit testing with github finally

* perl_ci.yml: update OS; only one perl version

* apt before cpanm

* perl_ci.yml: apt-get update

* perl_ci.yml: force a perl cache

* trying to cache again

* perl_ci.yml: --no-test --force

* perl_ci.yml: remove bio::kmer from cache

* perl_ci.yml: typo

* perl_ci.yml: add in more apt-get

* perl_ci.yml: enable-modules-cache:true

* perl_ci.yml: cpanm installdeps

* perl_ci.yml: modules and versions checking

* perl_ci.yml: make test

* perl_ci.yml: add in libdb-dev

* perl_ci.yml: force notest cpanm

* perl_ci.yml: force notest cpanm

* perl_ci.yml: force notest cpanm, second try

* use shogo82148/actions-setup-perl directly for testing cache

* update cache.yml

* update cache.yml

* update cache.yml

* cache.yml: added JSON

* install bio::perl natively in the github actions

* added threading; more modules

* multithreading for perl_ci

* simplify the apt/cpanm portions

* v1.3.1
  • Loading branch information
lskatz authored Aug 3, 2023
1 parent 8d9b9bf commit c71eb30
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: force-cache
on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-22.04']
perl: [ '5.34' ]
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- name: apt-get to prepare for cached perl packages
run: |
sudo apt-get update -y
sudo apt-get install -y libdb-dev sqlite3 libgd-dev libsqlite3-dev libberkeleydb-perl libcdb-file-perl
- uses: actions/checkout@v3
- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.34'
install-modules-with: cpanm
install-modules-args: --with-develop --with-configure
multi-thread: true
install-modules: |
JSON
Bio::Perl
Bio::Kmer
Bio::Tree::Statistics
Bio::Matrix::IO
Bio::Tree::DistanceFactory
- run: |
echo "hello world!"
# prove -lv t
49 changes: 49 additions & 0 deletions .github/workflows/perl_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# https://docs.github.com/en/actions/guides/publishing-docker-images
# https://github.com/docker/build-push-action/blob/master/docs/advanced/share-image-jobs.md
name: unit-testing
on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-22.04']
perl: [ '5.34' ]
#perl: [ '5.34', '5.32', '5.16.3' ]
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
install-modules-with: cpanm
install-modules-args: --with-develop --with-configure --force --no-test
enable-modules-cache: true
multi-thread: true
install-modules: |
JSON
Bio::Perl
Bio::Kmer
Bio::Tree::Statistics
Bio::Matrix::IO
Bio::Tree::DistanceFactory
- name: apt-get to prepare for cached perl packages
run: |
sudo apt-get update -y
sudo apt-get install -y libdb-dev sqlite3 libgd-dev libsqlite3-dev libberkeleydb-perl libcdb-file-perl quicktree mash
- name: cpanm installdeps --no-test --force
run: cpanm --installdeps . --no-test --force
- name: versions
run: |
mash --version
quicktree -v
sqlite3 --version
- run: perl -V
- name: perl modules checks
run: |
for i in Bio::Tree::Statistics threads Bio::Matrix::IO Bio::Tree::DistanceFactory; do perl -M$i -e 'print "checking module $i";'; done
- name: make test
run: perl Makefile.PL && make && make test
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ inc/
/MANIFEST.bak
/pm_to_blib
/*.zip

# temp testing files
t/lambda/lambda.fofn
t/lambda/lambda/
t/lambda/list.lst
t/lambda/mashtree2.tmp/
t/lambda/sketches/
t/lambda/tmp.dnd
t/lambda/tmp/

2 changes: 1 addition & 1 deletion lib/Mashtree.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local $0=basename $0;
######
# CONSTANTS

our $VERSION = "1.3.0";
our $VERSION = "1.3.1";
our $MASHTREE_VERSION=$VERSION;
our @fastqExt=qw(.fastq.gz .fastq .fq .fq.gz);
our @fastaExt=qw(.fasta .fna .faa .mfa .fas .fsa .fa);
Expand Down
4 changes: 4 additions & 0 deletions t/10_sqlite.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ use File::Basename qw/dirname/;
use File::Temp qw/tempdir/;
use Data::Dumper;

use FindBin qw/$RealBin/;
use lib "$RealBin/../lib/perl5";
use lib "$RealBin/../lib/perl5/x86_64-linux-thread-multi/";

use Test::More tests => 5;

use_ok 'Mashtree';
Expand Down

0 comments on commit c71eb30

Please sign in to comment.