Quick reference for .travis.yml configuration files on Travis CI.
Language Environments
Node.js Configuration
language: node_js
node_js:
- '18'
- '20'
script:
- npm test
Ruby Configuration
language: ruby
rvm:
- 3.1
- 3.2
script:
- bundle exec rake test
Build Lifecycle Phases
The Travis CI build lifecycle executes in the following sequence:
before_installinstallbefore_scriptscriptafter_successorafter_failureafter_scriptbefore_deploy(optional)deploy(optional)after_deploy(optional)
Custom Script Steps
before_script:
- make pretest
script:
- make test
after_script:
- make clean
Branch Filtering
branches:
only:
- main
- /^release-.*$/
except:
- legacy
Matrix and Environment Variables
env:
- DB=postgresql
- DB=mysql
System Dependencies with Apt
addons:
apt:
packages:
- libcurl4-openssl-dev