Travis CI is a Continuous Integration platform for GitHub projects.
Travis CI can run the projects’ tests automatically whenever new code is pushed to the repo. This ensures that existing functionality and features have not been broken by the changes.
The current Travis CI set up performs the following things whenever someone push code to the repo:
./gradlew clean headless allTests coverage coveralls -i
command
(see UsingGradle.md for more details on what this command means).If you would like to customise your travis build further, you can learn more about Travis from Travis CI Documentation.
From this repository, fork and clone it to your computer.
Go to https://travis-ci.org/ and click Sign in with GitHub
as shown in Figure 1, then enter your GitHub account details if needed.
Review and add
as shown in Figure 2: This should bring you to a GitHub page that manages the access of third-party applications. Depending on whether you are the owner of the repository, you can either do one of the following to Travis CI so that it can access your commits and build your code:
Sync account
..travis.yml
that tells Travis what to do, so there is no need for you to create one yourself.README.md
to point to the build status of your own repo.
In addition to running Gradle checks, we also configure Travis CI to run some repository-wide checks.
Unlike the Gradle checks which only cover files used in the build process, these repository-wide checks cover all files in the repository.
They check for repository rules which are hard to enforce on development machines such as
line ending requirements.
These checks are implemented as POSIX shell scripts, and thus can only be run on POSIX-compliant operating systems such as macOS and Linux. To run all checks locally on these operating systems, execute the following in the repository root directory:
./config/travis/run-checks.sh
Any warnings or errors will be printed out to the console.
Checks are implemented as executable check-*
scripts within the config/travis/
directory.
The run-checks.sh
script will automatically pick up and run files named as such.
Check scripts should print out errors in the following format:
SEVERITY:FILENAME:LINE: MESSAGE
where
SEVERITY
is either ERROR
or WARN
,FILENAME
is the path to the file relative to the current directory,LINE
is the line of the file where the error occurredMESSAGE
is the message explaining the error.Check scripts must exit with a non-zero exit code if any errors occur.