miyagawa / cpanminus

cpanminus - get, unpack, build and install modules from CPAN
http://cpanmin.us
750 stars 213 forks source link

Advertise install-with-cpanm GitHub action #608

Open atoomic opened 4 years ago

atoomic commented 4 years ago

This is still in early development phase and pretty dumb, but I would like to let you know of the release of install-with-cpanm GitHub action

https://github.com/marketplace/actions/install-with-cpanm

This action allows to install cpanm on a container (linux, windows, ...) and optionally install several modules from a list or a cpanfile.

This case was created to inform you and maybe consider adding some note to the documentation referencing it, so people can start taking advantages of it.

Here are several examples using it: https://github.com/perl-actions/install-with-cpanm/actions/runs/81136053

Some basic syntax:

- name: install cpanm and multiple modules
  uses: perl-actions/install-with-cpanm@v1.1
  with:
    install: |
      Simple::Accessor
      Test::Parallel

# or you can use a cpanfile
#     cpanfile: 'your-cpanfile'
# default values you can customize
#     sudo: true
# where to install cpanm
#     path: "$Config{installsitescript}/cpanm"
# which perl binary to use
#     perl: 'perl'

Using install-with-cpanm in a GitHub workflow

Here is a sample integration using install-with-cpanm action to test your Perl Modules using multiple Perl versions via the perl-tester images.

# .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-with-cpm
        uses: perl-actions/install-with-cpanm@v1.1
        with:
          cpanfile: "cpanfile"
          sudo: false
      - run: perl Makefile.PL
      - run: make test

you can read more from https://github.com/perl-actions/install-with-cpanm