Travis CI and Coveralls with ActionScript 3

Waiting for a complete article about using Travis CI with Maven and Coveralls, on your ActionScript (Flex/Air/Vanilla) project, i just wanted to share with you this enhancements

First, here you’ll find a complete working project (Travis/Maven/Coveralls) with the modifications i’m suggesting.

I’ve followed this repo on GitHub to setup my project but i wasn’t satisfied of the result.

So i’ve made some modifications to the code after 2 days of research:

  • I’ve edited getFpFromArchive to extract from the latest zip the .dmg because there is no more zip file inside.
  • Added this code to travis.yaml because Travis was searching for “flashplayer” and not “Flash Player”
1
- cp Flash\ Player\ Debugger.app/Contents/MacOS/Flash\ Player\ Debugger Flash\ Player\ Debugger.app/Contents/MacOS/flashplayer
  • Update flexunit to v4.2

CodeCoverage

pom.xml

To enable code coverage just add this configuration

1
2
3
<coverage>true</coverage>
<coverageProvider>cobertura</coverageProvider>
<coverageReportFormat><param>xml</param></coverageReportFormat>

and this plugin

pom.xml

1
2
3
4
5
6
7
8
9
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<branch>develop</branch>
<coberturaReports><file>${project.build.directory}/coverage/coverage.xml</file></coberturaReports>
</configuration>
</plugin>

Call code coverage plugin after succes to send report to coveralls:

travis.yml

1
2
after_success:
- mvn coveralls:report

N.B.

if you don’t want that the report use .java extensions for your files ( it’s a bug with FlexMojos ) you should use:

pom.xml

1
<flexmojos.version >4.2-beta</flexmojos.version >