Simple hello print test
- GitHub account
As this is a Learning-by-doing
repo exercice, avoid cloning the repo but rather create the required files from scratch
- Go to travis-ci.com and sign up with GitHub
- Accept the Authorization of Travis CI. You’ll be redirected to GitHub.
- Click on your profile picture in the top right of your Travis Dashboard, click Settings and then the green Activate button, and select the repositories you want to use with Travis CI.
- Travis will take a few mins to sync with the GitHub repo
- Needs to be public, contains a readme file and MIT License
.travis.yml :
language: generic
sudo: required
script:
- bash test_hello.sh
hello.sh :
#!/usr/bin/env bash
echo "hello"
test_hello.sh :
#!/usr/bin/env bash
# test that hello.sh outputs hello
OUT=$(bash ./hello.sh)
if [ ${OUT} = "hello" ] ; then
echo "Output is hello"
exit 0
else
echo "Output is not hello"
echo ${OUT}
exit 1
fi
- Compare & pull request
- Create pull request
- Edit hello.sh (replace hello with bye)
#!/usr/bin/env bash
echo "bye"
- See how the checks are now failing in GH
- And how the build failed in travis