Travis CI における .travis.yml 設定ファイルのクイックリファレンスです。
言語環境
Node.js 設定
language: node_js
node_js:
- '18'
- '20'
script:
- npm test
Ruby 設定
language: ruby
rvm:
- 3.1
- 3.2
script:
- bundle exec rake test
ビルドライフサイクルのフェーズ
Travis CI のビルドライフサイクルは以下の順序で実行されます:
before_installinstallbefore_scriptscriptafter_successまたはafter_failureafter_scriptbefore_deploy(任意)deploy(任意)after_deploy(任意)
カスタムスクリプト手順
before_script:
- make pretest
script:
- make test
after_script:
- make clean
ブランチフィルタリング
branches:
only:
- main
- /^release-.*$/
except:
- legacy
マトリックスと環境変数
env:
- DB=postgresql
- DB=mysql
Apt によるシステム依存パッケージ
addons:
apt:
packages:
- libcurl4-openssl-dev