Testing with AppVeyor

If you ever wanted to test your CPAN modules on Windows systems without having an own Windows system setup, then you should take a look at AppVeyor. Basically it's something like travis-ci, but just running on Windows. Configuration happens in a YAML file named appveyor.yml.

A sample appveyor.yml file for testing CPAN distributions may look like this:

branches:
  except:
    - /travis/
skip_tags: true

cache:
- C:\strawberry

install:
- if not exist "C:\strawberry" cinst strawberryperl
- set PATH=C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH%
- cd C:\projects\%APPVEYOR_PROJECT_NAME%
- cpanm --installdeps .

build_script:
- perl Makefile.PL
- dmake test

The install entry is installing StrawberryPerl using chocolatey, a package manager for Windows, and CPAN dependencies with cpanm. The build_script entry is actually building and testing the distribution. These two entries are actually necessary for a minimal appveyor.yml file. The cache entry is useful to cache the downloaded StrawberryPerl, and, maybe more importantly, especially for large dependency trees, any CPAN module which was installed in the "install" step. The branches entry is just a private convention of mine (branches named XXX-travis-ci should be tested only on travis-ci and XXX-appveyor only on AppVeyor).

Here are more sample appveyor.yml files:

4 Comments

AppVeyor is so confusing, this is the best docs for Perl I've yet seen. Thank you! Finally, Windows CI Testing!

The strawberryperl package of chocolatey is somewhat badly packaged and outdated. We need someone to fix/improve it and update Perl to .24.

I found another manager with 5.24 available: https://npackd.appspot.com/p/com.strawberryperl.StrawberryPerl64

So the appveyor script can be changed to accomodate it if necessary.

Fantastic! I dropped this file into Business::ISBN and it works. I wish I'd known about this service sooner.

And, when it ran it chose v5.24.1, so I guess that's fixed.

Leave a comment

About eserte

user-pic I blog about Perl.