DEV Community

Yuki Kimoto
Yuki Kimoto

Posted on • Edited on

1

Github Action Workflows for Perl Modules - Perl Club

Github Action workflows for Perl modules.

Github Action Workflows for Perl Modules - Perl Club

Although these Github Action workflows was created for the SPVM project of Perl Club, All Perl modules can use these without any changes.

Features

  • Supports Linux Ubuntu latest, Mac latest, Windows Server latest, Windows Server 2019
  • Supports 32bit on Linux/Ubuntu
  • Supports Perl 5.8.9 on Linux/Ubuntu
  • cpanm is downloaded in the workflow.
  • Resolves CPAN module dependencies.
  • ExtUtils::MakeMaker and make are used.
  • Each workflow is portable in all versions of Perl, Linux, Mac, Windows except for setting environment variables

Download by Command

This Github Action workflows can be downloaded using commands.

mkdir -p .github/workflows

# linux-ubuntu-latest
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/linux-ubuntu-latest.yml > .github/workflows/linux-ubuntu-latest.yml

# linux-ubuntu-latest-32bit
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/linux-ubuntu-latest-32bit.yml > .github/workflows/linux-ubuntu-latest-32bit.yml

# linux-ubuntu-latest-perl-5.8.9
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/linux-ubuntu-latest-perl-5.8.9.yml > .github/workflows/linux-ubuntu-latest-perl-5.8.9.yml

# macos-latest
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/macos-latest.yml > .github/workflows/macos-latest.yml

# windows-latest
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/windows-latest.yml > .github/workflows/windows-latest.yml

# windows-2019
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/windows-2019.yml > .github/workflows/windows-2019.yml

# Show Github Action workflows
ls -l .github/workflows
Enter fullscreen mode Exit fullscreen mode

Makefile.PL Example

An example of Makefile.PL. This is Makefile.PL that is generated by the spvmdist command.

use 5.008_007;
use ExtUtils::MakeMaker;
use strict;
use warnings;
use Config;
use Getopt::Long 'GetOptions';

GetOptions(
  'meta' => \my $meta,
);

unless ($meta) {
  # Do something such as environment check.
}

WriteMakefile(
  NAME              => 'Foo',
  VERSION_FROM      => 'lib/Foo.pm',
  LICENSE           => 'perl_5',
  ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
    (ABSTRACT_FROM  => 'lib/Foo.pm',
     AUTHOR         => 'USER_NAME<USER_MAIL>') : ()),
  test => {TESTS => 't/*.t t/*/*.t t/*/*/*.t'},
  clean => {FILES => []},
  META_MERGE => {
    'meta-spec' => { version => 2 },
    resources => {
      repository => {
        type => 'git',
        url  => '',
        web  => '',
      },
    },
    no_index => {
      directory => [],
    }
  },
  NORECURS => 1,
  CONFIGURE_REQUIRES => {
  },
  PREREQ_PM         => {
  },
  TEST_REQUIRES => {

  },
);

1;
Enter fullscreen mode Exit fullscreen mode

How to use this with Module::Build

Please replace ExtUtils::MakeMaker with Module::Build in the workflows.

And replace build process with the following command.

perl Build.PL
./Build
./Build disttest
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more