Skip to content

Travis CI

Khoale1096 edited this page May 29, 2020 · 8 revisions

We automate a lot of this project with the help of Travis CI.

Getting started with Travis

  1. Make an account on travis-ci.com NOT travis-ci.org.
  2. Link the account to your GitHub Account
  3. Go to: https://travis-ci.com/github/reichlab/covid19-forecast-hub

How Travis CI works

Travis first looks at the .travis.yml file in the root directory and spins up a VM with Travis servers to perform a series of tasks that we determine.

.travis.yml File

The mandatory Travis set up file which is run at every build automatically. In our case, we specify additional scripts to execute with script: ./travis-main.sh.

  1. Configures the VM operating system, dependencies, and cached libraries
  2. Runs the main execution script: script: ./travis-main.sh

travis-main.sh

A bash script that executes a series of scripts to:

  • Validate the incoming data (source ./travis/validate-data.sh)
    • Runs at: every build on master
  • Update the truth data (bash ./travis/update-truth.sh)
    • Runs at: cron job @ 6:30am
  • Upload forecasts to zoltar (bash ./travis/upload-to-zoltar.sh)
    • Runs at: every merged pull request
  • Update already validated files (cp ./code/validation/locally_validated_files.csv ./code/validation/validated_files.csv)
    • Runs at: every build except PRs
  • Test uploading forecasts to zoltar manually
    • Runs at: any commit with "test zoltar upload" in the message
  • Test uploading truth to zoltar manually
    • Runs at: any commit with "test truth" in the message

All scripts run on Travis can be found in ./travis/