diff --git a/.github/workflows/perl_versions.yml b/.github/workflows/perl_versions.yml new file mode 100644 index 0000000..5efdabd --- /dev/null +++ b/.github/workflows/perl_versions.yml @@ -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 diff --git a/cpanfile b/cpanfile index be55c36..f77c400 100644 --- a/cpanfile +++ b/cpanfile @@ -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'; };