Skip to content

perl-actions/get-prereqs

Repository files navigation

get-prereqs

GitHub action to get prerequisites for a local CPAN distribution.

- id: get-prereqs
  name: Get prerequisites
  uses: perl-actions/get-prereqs@v1
- name: Install prerequisites
  uses: perl-actions/install-with-cpanm@v1
  with:
    install: ${{ steps.get-prereqs.outputs.prereqs }}

Inputs

phases

List of phases to get prerequsites for, as defined in CPAN::Meta::Spec.

Defaults to build test runtime.

relationships

List of relationships to get prerequsites for, as defined in CPAN::Meta::Spec.

Defaults to requires.

features

List of optional features to include prequisites for, as defined in CPAN::Meta::Spec.

Defaults to none.

sources

List of files to search for prerequisites. Supported formats are:

  • META files in JSON and YAML formats.
  • cpmfile in JSON and YAML formats.
  • cpanfile files as generated by Module::CPANfile or Dist::Zilla::Plugin::CPANFile. These are parsed statically, supporting the most commonly used formats of cpanfile found in the wild. cpanfiles using dynamic checks or non-version parameters are not supported. These files must be named cpanfile.
  • Prereqs File in JSON and YAML formats. These files must named prereqs.yml or prereqs.json.
  • Makefile as emitted by ExtUtils::MakeMaker. This was used to communicated dependencies before MYMETA files were invented.
  • _build/params as emitted by Module::Build. This was used to communicate dependencies before MYMETA files were invented.
  • dist.ini as used by Dist::Zilla. This extracts the modules needed to run dzil build. This is mostly equivalent to the output of dzil authordeps. The prereqs will use the unofficial phase of author.
  • Makefile.PL, scanned for use v5.xx; or MIN_PERL_VERSION => "5.xxx" declarations.

Defaults to MYMETA.json MYMETA.yml META.json META.yml Makefile _build/params cpanfile.

exclude

A list of regular expressions of prerequisites to exclude. One pattern per line.

Outputs

perl

The perl version declared as a prerequisite. Formatted like v5.30.

prereqs

The prerequisites declared including the required versions, formatted as expected by cpanm or cpm.

prereqs-no-version

The prerequisites declared, not including the required versions.

prereqsJSON

The prerequisites declared, formatted as a JSON string. The keys of the object will be the module name, and the values will be the versions required.