Skip to content

Commit

Permalink
Merge pull request #18 from jmtcsngr/devel
Browse files Browse the repository at this point in the history
merge from devel to master
  • Loading branch information
jmtcsngr authored Nov 29, 2023
2 parents c4e3a99 + 865199c commit 41cfeb4
Show file tree
Hide file tree
Showing 961 changed files with 47,479 additions and 170,054 deletions.
1 change: 1 addition & 0 deletions .github/workflows/perlbrew.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c3996e4fae37a0ae01839cdd73752fb7b17e81bac2a8b39712463a7d518c4945 perlbrew.sh
127 changes: 127 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: "Unit tests"

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l -e -o pipefail {0}

env:
PERL_CACHE: ~/perl5 # Perlbrew and CPAN modules installed here, cached
NPG_LIB: ~/perl5npg # NPG modules installed here, not cached
WSI_NPG_GITHUB_URL: https://github.com/wtsi-npg
WSI_NPG_BUILD_BRANCH: ${{ github.base_ref || github.ref }}


strategy:
matrix:
perl: ["5.26.3", "5.34.1"]

services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: null
MYSQL_DATABASE: npgt
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=5

steps:
- uses: actions/checkout@v3

- name: Change dbhost to 127.0.0.1
run: |
sed -i s/localhost/127.0.0.1/ ${GITHUB_WORKSPACE}/data/config.ini
- name: set timezone
run: |
sudo timedatectl set-timezone Europe/London
- name: "Install OS dependencies"
run: |
sudo apt-get update
# https://github.com/actions/runner-images/issues/2139
sudo apt-get remove -y nginx libgd3
sudo apt-get install -y libgd-dev uuid-dev libgd-text-perl
- name: "Cache Perl"
id: cache-perl
uses: actions/cache@v3
with:
path: ${{ env.PERL_CACHE }}
key: ${{ runner.os }}-${{ matrix.perl }}-perl

- name: "Install Perlbrew"
if: steps.cache-perl.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.perlbrew.pl -o perlbrew.sh
sha256sum -c .github/workflows/perlbrew.sha256
export PERLBREW_ROOT=${{ env.PERL_CACHE }}
sh perlbrew.sh
source ${{ env.PERL_CACHE }}/etc/bashrc
perlbrew available
perlbrew install --notest perl-${{ matrix.perl }}
perlbrew use perl-${{ matrix.perl }}
perlbrew install-cpanm
- name: "Initialize Perlbrew"
run: |
echo "source ${{ env.PERL_CACHE }}/etc/bashrc" >> "$HOME/.bash_profile"
- name: "Install Perl dependencies"
run: |
cpanm --local-lib=${{ env.PERL_CACHE }} local::lib
eval $(perl -I ${{ env.PERL_CACHE }}/lib/perl5/ -Mlocal::lib="$NPG_LIB")
eval $(perl -I ${{ env.PERL_CACHE }}/lib/perl5/ -Mlocal::lib)
cpanm --quiet --notest Module::Build
cpanm --quiet --notest Alien::Tidyp
./scripts/install_wsi_dependencies.sh "$NPG_LIB" \
perl-dnap-utilities \
ml_warehouse
cpanm --installdeps --notest .
- name: "Log install failure"
if: ${{ failure() }}
run: |
find ~/.cpanm/work -cmin -1 -name '*.log' -exec tail -n20 {} \;
- name: "Archive CPAN logs on failure"
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: cpan_log
path: ~/.cpanm/work/*/build.log
retention-days: 5

- name: "Run tests"
run: |
eval $(perl -I ${{ env.PERL_CACHE }}/lib/perl5/ -Mlocal::lib)
eval $(perl -I ${{ env.PERL_CACHE }}/lib/perl5/ -Mlocal::lib="$NPG_LIB")
export TEST_AUTHOR=1
perl Build.PL
./Build test --verbose
./Build install
- name: "Build distribution"
run: |
eval $(perl -I ${{ env.PERL_CACHE }}/lib/perl5/ -Mlocal::lib)
eval $(perl -I ${{ env.PERL_CACHE }}/lib/perl5/ -Mlocal::lib="$NPG_LIB")
export TEST_AUTHOR=1
./Build dist
export DIST_FILE=$(ls npg-tracking-*.tar.gz)
export MD5_FILE=$DIST_FILE.md5
md5sum $DIST_FILE > $MD5_FILE
export SHA256_FILE=$DIST_FILE.sha256
shasum -a 256 $DIST_FILE > $SHA256_FILE
93 changes: 0 additions & 93 deletions .github/workflows/testing_and_building_repos.yml

This file was deleted.

8 changes: 5 additions & 3 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,25 @@ my $builder = $class->new(
'base' => '2.12',
'Carp' => '1.04',
'CGI' => '3.52',
'Class::Accessor' => '0.31',
'Class::Load' => 0,
'Class::Std' => '0.0.8',
'ClearPress' => '>= 473.3.3',
'Config::Any' => 0,
'Config::Auto' => 0,
'Crypt::CBC' => 0,
'Cwd' => 0,
'Data::UUID' => 0,
'Date::Parse' => '2.27',
'DateTime' => '0.5',
'DateTime::TimeZone' => 0,
'DateTime::Format::MySQL' => 0,
'DateTime::Format::Strptime' => '1.0702',
'DBD::mysql' => 0,
'DBD::mysql' => '== 4.050',
'DBI' => '1.608',
'DBIx::Class' => '0.08119',
'DBIx::Class::Core' => 0,
'DBIx::Class::Schema' => 0,
'DBIx::Class::Schema::Loader' => 0,
'DBIx::Class::InflateColumn::DateTime' => 0,
'Digest::MD5' => 0,
'Digest::SHA' => 0,
Expand Down Expand Up @@ -208,9 +209,9 @@ my $builder = $class->new(
'SQL::Translator' => '0.11006',
'Sys::Hostname' => '1.11',
'Template' => '2.19',
'Text::CSV' => '0',
'Try::Tiny' => 0,
'URI::Escape' => 0,
'URI::URL' => 0,
'utf8' => 0,
'warnings' => '1.05',
'XML::LibXML' => '1.70',
Expand All @@ -219,6 +220,7 @@ my $builder = $class->new(

'WTSI::DNAP::Utilities::Loggable' => '>= 0.5.3',
'WTSI::DNAP::Utilities::Timestamp' => '0',
'WTSI::DNAP::Warehouse::Schema' => '0',
},
);

Expand Down
Loading

0 comments on commit 41cfeb4

Please sign in to comment.