Skip to content

Commit

Permalink
Test Perl Versions with perlbrew
Browse files Browse the repository at this point in the history
  • Loading branch information
bodo-hugo-barwich committed Oct 7, 2023
1 parent 53cd144 commit 64980ac
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/perl_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Testing against Perl Versions

on:
pull_request:
branches: [ master ]
workflow_dispatch:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
perl-version-testing:

runs-on: ubuntu-20.04
strategy:
matrix:
perl-version: [ "5.10.1", "5.16", "5.24", "5.32.1", "5.36.0", "5.38.0" ]

steps:
# 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
run: |
echo "perlbrew - Inspect Available Perl Versions"
perlbrew available
perlbrew list
- name: Install requested Perl Version
run: |
echo "perlbrew - Install Perl Version '${{ matrix.perl-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 ${{ matrix.perl-version }} ~/perl5/perlbrew/perls/perl-${{ matrix.perl-version }} && perlbrew switch ${{ matrix.perl-version }}
perl -v
- name: Run the Test Suite
run: |
echo "Build and Test the Module"
perl Makefile.PL
make build
make test TEST_VERBOSE=1
2 changes: 1 addition & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on 'test' => sub {
requires 'Capture::Tiny';
};

feature 'test_perl-5.10', 'testing in perl 5.10' => sub {
feature 'test_perl-versions', 'testing in different Perl Versions' => sub {
requires 'local::lib';
requires 'Perl::Build';
};

0 comments on commit 64980ac

Please sign in to comment.