Starting at CPAN::Digger I found the Math::Numerical distribution without any Continuous Integration configured.
Adding GitHub Actions to this project was quite straigh forward except for two things:
Adding prerequisites
I had to manually install some prerequsites that were needed for the tests:
- name: Install Modules
run: |
cpanm -v
cpanm --installdeps --notest .
cpanm --notest Test2::V0
cpanm --notest Test2::Tools::PerlCritic
cpanm --notest Test::Pod
cpanm --notest IPC::Run3
cpanm --notest Readonly
This has been bothering me for some time now so I asked both on Reddit and on PerlMonks.
Disable Windows
I think at the time I was doing this there was some problem with the Windows infrastructure of GitHub Actions or the Perl that was supposed to be installed on Windows so I had to disable the Windows runner. The author of the module can later enable it to see if the isses were fixed already.
Speed
It took 9-10 minutes to run the job on OSX. (5 min on Ubuntu Linux) The main time consuming part is the installation of the test prerequisites. I added the --notest flag to the cpanm commands that reduced the run-time to 2 minutes.
Full configuration file
examples/math-numerical-ci.yml
name: Perl
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, macos-latest] # , windows-latest
perl: [ '5.36' ]
runs-on: ${{matrix.runner}}
name: OS ${{matrix.runner}} Perl ${{matrix.perl}}
steps:
- uses: actions/checkout@v2
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
distribution: ${{ ( startsWith( matrix.runner, 'windows-' ) && 'strawberry' ) || 'default' }}
- name: Show Perl Version
run: |
perl -v
- name: Install Modules
run: |
cpanm -v
cpanm --installdeps --notest .
cpanm --notest Test2::V0
cpanm --notest Test2::Tools::PerlCritic
cpanm --notest Test::Pod
cpanm --notest IPC::Run3
cpanm --notest Readonly
- name: Run tests
env:
TEST_AUTHOR: 1
run: |
perl Makefile.PL
make
make test
- name: Show Errors on Windows
if: ${{ failure() && startsWith( matrix.runner, 'windows-')}}
run: |
ls -l C:/Users/
ls -l C:/Users/RUNNER~1/
cat C:/Users/runneradmin/.cpanm/work/*/build.log
- name: Show Errors on Ubuntu
if: ${{ failure() && startsWith( matrix.runner, 'ubuntu-')}}
run: |
cat /home/runner/.cpanm/work/*/build.log
- name: Show Errors on OSX
if: ${{ failure() && startsWith( matrix.runner, 'macos-')}}
run: |
cat /Users/runner/.cpanm/work/*/build.log