Access to your project's repo will need to be enabled in both Travis and Coveralls. When commits are pushed, the build will run automatically.
Note that these services only support projects hosted on Github. Private repos will require paid accounts at both.
A working project that may be used as a template: sample-apex-library.
Expected file structure is standard;
src folder in root directory and a
package.xml file under it referencing the package's metadata.
.travis.yml file will also be needed.
language: node_jsnode_js:- nodegit:depth: 1install:- npm install -g sfdc-travisci-coverallsscript:- sfdc-travisci-coveralls
The build will also need an org to be run against. A solid option for this is to sign up a free developer org, a separate one for each project.
In the TravisCI configuration for the project, you'll need to add some environment variables:
SFDC_LOGINURL- eg. https://login.salesforce.com
SFDC_TOKEN- security token
COVERALLS_REPO_TOKEN- found on the project's Coveralls page
.travis.yml file and push.
Travis will immediately start running the build. If either the deployment or tests fail, the build will exit with a failing status.
- Deploys the package
- Runs tests found in the package on the org
- Retrieves and parses Apex coverage results
- Posts coverage to Coveralls.io