Adapted from https://docs.travis-ci.com/user/for-beginners
- On GitHub, fork this repository.
- Clone the repository
git clone {repository url}
- Sign in to Travis CI with your GitHub account, accepting the GitHub access permissions confirmation.
- Go to your profile page and enable Travis CI builds for your fork of the travis-example repository.
- Take a look at .travis.yml, the file which tells Travis CI what to do. This file tells Travis CI to install the dependencies and run npm test.
- Edit the empty NewUser.txt file by adding your name to the empty file. Add the file to git, commit and push, to trigger a Travis CI build:
$ git add .
$ git commit -m 'Testing Travis CI'
$ git push
- Wait for Travis CI to run a build on your fork of the travis-example repository, check the build status and notice that the build fails. (Travis CI sends you an email when this happens)
- Fix the code by making sure that 2=1+1 in tests/test.spec.js, commit and push to GitHub. This time, the build does not fail.
$ git add .
$ git commit -m 'Testing Travis CI: fixing the build'
$ git push
Congratulations, you have added a GitHub repository to Travis and learnt the basics of configuring builds and testing code.