Testing with Perl Version Matrix #20
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: Testing against Perl Versions | |
on: | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
branches: [ master ] | |
jobs: | |
perl-version-testing: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
perl-version: [ "5.10", "5.16", "5.24", "5.32", "5.36", "5.38" ] | |
steps: | |
- name: Listing Directory Contents | |
run: | | |
echo "USER: " $(whoami) | |
echo "HOME: '$HOME'" | |
pwd | |
ls -lah | |
# List all installed Perl Libraries | |
- name: List all installed Perl Libraries | |
run: | | |
dpkg --get-selections | grep -i perl | sort | |
echo "Perl Version:" | |
perl --version | |
# Install missing Perl Libraries | |
- name: Install Perl Libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install perlbrew cpanminus liblocal-lib-perl | |
sudo apt-get -y install libdevel-patchperl-perl libcpan-perl-releases-perl libmodule-build-perl libmodule-build-tiny-perl | |
sudo apt-get -y install libextutils-config-perl libextutils-helpers-perl libextutils-installpaths-perl | |
sudo apt-get -y install libfile-which-perl libipc-run3-perl libhttp-tiny-perl | |
sudo apt-get -y install libgetopt-long-descriptive-perl libcapture-tiny-perl libdata-dump-perl libpath-tiny-perl | |
sudo apt-get -y install libcpanel-json-xs-perl libjson-xs-perl libjson-perl libyaml-libyaml-perl libyaml-perl | |
- name: Inspect Available Perl Versions | |
id: perl_full_version | |
run: | | |
echo "perlbrew - Inspect Available Perl Versions" | |
echo "perlbrew - Environment:" | |
perlbrew env | |
echo "Perl - Available Versions:" | |
perlbrew available | |
echo "Perl - Installed Versions:" | |
perlbrew list | |
full_version=`perlbrew available | grep "${{ matrix.perl-version }}" | sed -re 's/.*perl-([0-9]+\.[0-9]+\.[0-9]+).*/\1/' | sed -n 1p` | |
echo "Perl - Requested Version:" $full_version | |
echo "version=$full_version" >> $GITHUB_OUTPUT | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Install requested Perl Version | |
run: | | |
echo "perlbrew - Install Perl Version '${{ matrix.perl-version }}'" | |
echo "perlbrew - Perl Full Version '${{ steps.perl_full_version.outputs.version }}'" | |
perl -Mlocal::lib | |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | |
cpanm -v --installdeps --with-feature=test_perl-versions . | |
perl-build --definitions ; | |
perl-build ${{ steps.perl_full_version.outputs.version }} ~/perl5/perlbrew/perls/perl-${{ steps.perl_full_version.outputs.version }} | |
echo "perlbrew - Installed Versions:" | |
perlbrew list | |
echo "perlbrew - Exec with Perl Version '${{ steps.perl_full_version.outputs.version }}' ..." | |
perlbrew exec -q --with perl-${{ steps.perl_full_version.outputs.version }} perl -e 'print "perl ($] / $^V)\n"' | |
echo "perlbrew - Active Perl Version:" | |
perl -v && perl -MConfig -e 'print "perl ($] / $^V) path: $Config{perlpath}\n"' | |
- name: Run the Test Suite | |
run: | | |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | |
echo "perlbrew - Installed Versions:" | |
perlbrew list | |
echo "perlbrew - Switch to Perl Version '${{ steps.perl_full_version.outputs.version }}' ..." | |
perlbrew switch perl-${{ steps.perl_full_version.outputs.version }} && perl -v && perl -e 'print "perl ($] / $^V)\n"' | |
echo "Testing - Active Perl Version:" | |
perl -v && perl -MConfig -e 'print "perl ($] / $^V) path: $Config{perlpath}\n"' | |
echo "Build and Test the Module" | |
perl Makefile.PL | |
make | |
make test TEST_VERBOSE=1 |