GitHub action to install App::cpm
This action installs 'cpm' as root so you can then use it in your workflow.
- name: install cpm and multiple modules
uses: perl-actions/install-cpm@v1.2
with:
install: |
Simple::Accessor
Test::Parallel
# or you can use a cpanfile
# cpanfile: 'your-cpanfile'
# default values you can customize
# sudo: true
# version: master
# where to install cpm
# path: "$Config{installsitescript}/cpm"
# which perl binary to use
# perl: 'perl'
Here is a sample integration using install-cpm action to test your Perl Module using multiple Perl versions.
# .github/workflows/linux.yml
jobs:
perl_tester:
runs-on: ubuntu-latest
name: 'perl v${{ matrix.perl-version }}'
strategy:
fail-fast: false
matrix:
perl-version:
- '5.30'
- '5.28'
- '5.26'
# ...
# - '5.8'
container:
image: perldocker/perl-tester:${{ matrix.perl-version }}
steps:
- uses: actions/checkout@v2
- name: uses install-cpm
uses: perl-actions/install-cpm@v1.2
with:
cpanfile: 'cpanfile'
sudo: false
- run: perl Makefile.PL
- run: make test
List of one or more modules, separated by a newline \n
character.
Install modules from a cpanfile.
Boolean variable used to disable unit tests during installation Possible values: true | false [default: false]
Boolean variable used to install or not modules to @INC instead of local.
This variable controls the -g
option from cpm and is enabled by default.
Possible values: true | false [default: true]
Extra arguments to pass to the cplay command line.
Run commands as sudo: true | false [default: true]
Which perl path to use. Default to use perl
from the current PATH
.
Where to install cpm
. Default value is $Config{installsitescript}/cpm
.
Which version/tag of cpm
to install. Default is 'master' to use the latest version.
none
Just install cpm without running any install commands. You can then use cpm yourself in order commands.
- name: install cpm
uses: perl-actions/install-cpm@v1.2
# then you can use it
- run: 'sudo cpm install -g Simple::Accessor'
Just install cpm without running any install commands. You can then use cpm yourself in order commands.
- name: install cpm
uses: perl-actions/install-cpm@v1.2
with:
version: '0.990'
- name: install cpm and one module
uses: perl-actions/install-cpm@v1.2
with:
install: 'Simple::Accessor'
List modules seperated by a newline character \n
- name: install cpm and multiple modules
uses: perl-actions/install-cpm@v1.2
with:
install: |
Simple::Accessor
Test::Parallel
- name: install cpm and files from cpanfile
uses: perl-actions/install-cpm@v1.2
with:
cpanfile: 'your-cpanfile'
Install modules with tests.
- name: install cpm and files from cpanfile
uses: perl-actions/install-cpm@v1.2
with:
install: 'Simple::Accessor'
tests: true
Disable the -g
flag.
- name: install cpm and files from cpanfile
uses: perl-actions/install-cpm@v1.2
with:
install: 'Simple::Accessor'
global: false
sudo: false
- name: 'install cpm + cpanfile with args'
uses: perl-actions/install-cpm@v1.2
with:
cpanfile: 'your-cpanfile'
args: '--with-recommends --with-suggests'