AppVeyor combined Linux and Windows Perl module testing

AppVeyor is starting to support Ubuntu builds so I’m playing with some configurations for that by adjusting the pure Windows config I wrote about earlier.

There are a few things to note:

  • Commands that start with sh: are for the Linux side. Those with cmd: (or ps:) are for the Windows side. Everything else is for both sides.
  • I set a PERL5LIB environment variable. I’d rather not do that but without sudo there’s a private module directory. I could install with sudo but that’s a unix thing the Windows side would need to avoid. Maybe I’ll still do that.
  • Previously I was caching the results of the install phase but I haven’t figured out why AppVeyor no longer likes that. It makes for longer builds.
image:
  - Visual Studio 2015
  - Ubuntu

environment:
  PERL5LIB: /home/appveyor/perl5/lib/perl5

platform: x64

branches:
  only:
    - master

skip_tags: true

install:
  - cmd: if not exist "C:\strawberry" cinst strawberryperl
  - cmd: set PATH=C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH%
  - cmd: cd C:\projects\%APPVEYOR_PROJECT_NAME%
  - sh: sudo apt-get install build-essential git libssl-dev
  - sh: sudo apt-get install -y perl
  - sh: export PATH=/home/appveyor/perl5/bin:$PATH
  - perl -v
  - cpan App::cpanminus
  - cpanm --installdeps .

build_script:
  - perl Makefile.PL
  - cmd: gmake test
  - sh: make test