Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Perl with Test coverage report

name: CI

on:
  push:
  pull_request:
  workflow_dispatch:
#  schedule:
#    - cron: '42 5 * * *'

jobs:
  tests:
    strategy:
      fail-fast: false
      matrix:
        runner:
          - ubuntu-latest
          #- macos-latest
          #- windows-latest
        perl:
          - '5.30'
          - '5.42'
        #exclude:
        #  - runner: windows-latest
        #    perl: '5.36'

    runs-on: ${{matrix.runner}}
    name: OS ${{matrix.runner}} Perl ${{matrix.perl}}

    steps:
    - uses: actions/checkout@v6

    - name: Set up perl
      uses: shogo82148/actions-setup-perl@v1
      with:
          perl-version: ${{ matrix.perl }}
          distribution: ${{ ( matrix.runner == 'windows-latest' && 'strawberry' ) || 'default' }}

    - name: Show Perl Version
      run: |
        perl -v

    - name: Install Modules
      run: |
        cpanm -v
        cpanm --installdeps --with-develop --notest .
        # --with-configure
        # --with-recommends, --with-suggests

    - name: Run tests
      env:
        AUTHOR_TESTING: 1
        RELEASE_TESTING: 1
      run: |
        perl Makefile.PL
        make
        make test

  coverage:
    runs-on: ubuntu-latest
    needs: tests
    name: Test Coverage

    container:
      image: perldocker/perl-tester:5.42
    steps:
      - uses: actions/checkout@v6
      - name: Generate test coverage
        env:
          AUTHOR_TESTING: 1
          RELEASE_TESTING: 1
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          perl Makefile.PL
          make
          # cpanm --notest Devel::Cover
          # cpanm --notest Devel::Cover::Report::Coveralls
          cover -v
          perl -MDevel::Cover::Report::Coveralls -E 'say $Devel::Cover::Report::Coveralls::VERSION'
          cover -test -report coveralls

repository