Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull from devel to master to create release 6.29.1 #220

Merged
merged 4 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
94 changes: 94 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
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
WTSI_NPG_GITHUB_URL: https://github.com/wtsi-npg
WTSI_NPG_BUILD_BRANCH: ${GITHUB_HEAD_REF}

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

steps:
- uses: actions/checkout@v3

- 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)

./scripts/install_wsi_dependencies.sh "$NPG_LIB" perl-dnap-utilities

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")

./Build dist
export DIST_FILE=ml_warehouse-*.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
65 changes: 0 additions & 65 deletions .github/workflows/testing_and_building_repo.yml

This file was deleted.

3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
LIST OF CHANGES
---------------

release 6.29.1
- Switch to Perlbrew to obtain multiple Perl versions

release 6.29.0
- Add plate_number column to the pac_bio_run_well_metrics table and bring
DBIx classes up to date.
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.github/workflows/testing_and_building_repo.yml
Build.PL
Changes
lib/WTSI/DNAP/Warehouse/Schema.pm
Expand Down Expand Up @@ -43,7 +42,6 @@ lib/WTSI/DNAP/Warehouse/Schema/Result/SamplesExtractionActivity.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/TolSampleBioproject.pm
MANIFEST
README
scripts/install_npg_perl_dependencies.sh
t/00-critic.t
t/00-distribution.t
t/00-pod.t
Expand Down
51 changes: 0 additions & 51 deletions scripts/install_npg_perl_dependencies.sh

This file was deleted.

54 changes: 54 additions & 0 deletions scripts/install_wsi_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

set -e -u -x

WSI_NPG_GITHUB_URL=${WSI_NPG_GITHUB_URL:=https://github.com/wtsi-npg}
WSI_NPG_BUILD_BRANCH=${WSI_NPG_BUILD_BRANCH:=devel}

# The first argument is the install base for NPG modules, enabling them to be
# installed independently of CPAN dependencies. E.g. for cases where we want
# different caching behaviour.
NPG_ROOT="$1"
shift

repos=""
for repo in "$@" ; do
cd /tmp

# Clone deeper than depth 1 to get the tag even if something has been already
# committed over the tag
git clone --branch master --depth 3 "$WSI_NPG_GITHUB_URL/${repo}.git" "${repo}.git"
cd "/tmp/${repo}.git"

# Shift off master to appropriate branch (if possible)
git ls-remote --heads --exit-code origin "$WSI_NPG_BUILD_BRANCH" && \
git pull origin "$WSI_NPG_BUILD_BRANCH" && \
echo "Switched to branch $WSI_NPG_BUILD_BRANCH"
repos="$repos /tmp/${repo}.git"
done

# Install CPAN dependencies. The src libs are on PERL5LIB because of
# circular dependencies. The blibs are on PERL5LIB because the package
# version, which cpanm requires, is inserted at build time. They must
# be before the libs for cpanm to pick them up in preference.
for repo in $repos
do
export PERL5LIB="$PERL5LIB:$repo/blib/lib:$repo/lib"
done

for repo in $repos
do
cd "$repo"
cpanm --quiet --notest --installdeps .
perl Build.PL
./Build
done

# Finally, bring any common dependencies up to the latest version and
# install
for repo in $repos
do
cd "$repo"
cpanm --quiet --notest --installdeps .
./Build install --install-base "$NPG_ROOT"
done