Keep your dotfiles bug-free with Continuous Integration

Update: As of April 2020, I have switched over to GitHub Actions. Travis CI has become buggy and flaky over time and I got tired of trying to keep the builds green. My GitHub action scripts can be seen here.

Just like many software engineers, I maintain my config files for GNU/Linux and Mac OS in a git repository. Given that, I wrote a fair bit of them in interpreted code, notably, Bash, it is a bit hard to ensure that it is bug-free. The other problem I face is that packages on homebrew, the Mac OS package manager becomes obsolete and gets deleted from time to time.

I added CI testing on Travis CI to prevent these breakages and to ensure that my dotfiles are always in good shape for installation. The great thing about Travis CI is that it is entirely free for open-source repositories even for testing on Mac OS containers.

Here’s my Travis CI file, the updated version will be in the repository.

# Test on Both GNU/Linux and Mac OS

    - name: Test on GNU/Linux
      os: linux
      dist: trusty
      sudo: false
        - set -e
        - bash  # Test dotfile setup
        - bash setup/  # Test Ubuntu-specific setup
        - vim +BundleInstall +qall  # Install all vim bundles

    - name: Test on Mac OS X
      os: osx
      osx_image: xcode10.2
      sudo: required
        - set -eo pipefail
        - bash # Test dotfile setup
        - bash setup/  # Test Mac OS-specific setup
        - sudo bash setup/_macos
        - vim +BundleInstall +qall  # Install all vim bundles

Leave a Reply

Your email address will not be published. Required fields are marked *