Skip to content

Instantly share code, notes, and snippets.

@mugifly
Last active June 28, 2016 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mugifly/8fd9d0f5ff637c373b2827b84778bafe to your computer and use it in GitHub Desktop.
Save mugifly/8fd9d0f5ff637c373b2827b84778bafe to your computer and use it in GitHub Desktop.
Test of Perl project (dependency managed using cpanm & carton) on Circle-CI
machine:
environment:
# Path
PATH: "$PATH:/home/$USER/perl5/bin"
# cpanm - Install destination of libraries
PERL_CPANM_OPT: "--local-lib=/home/$USER/perl5"
# perl - Include path
PERL5LIB: "/home/$USER/perl5/lib/perl5:$PERL5LIB"
dependencies:
cache_directories:
- ~/perl5
- local
pre:
# Install the cpanm (cpanminus) command
- curl -L https://cpanmin.us | perl - App::cpanminus
# Install the carton command using cpanm
- cpanm Carton
override:
# Install the dependency cpan modules using cpanfile
- carton install
test:
override:
# Run the tests
- carton exec -- prove -l -m -Q -r t/ --formatter=TAP::Formatter::JUnit> result.xml
# Convert charset of the test results
# Thanks for http://qiita.com/uchiko/items/65254be5e9504c9c1742
- perl -i -ple 's/\[\\x([a-f0-9]{2})\]/pack("H*", $1)/egx' result.xml
# Copy the test results to Circle-CI Artifacts
- cp result.xml $CIRCLE_TEST_REPORTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment