Travis config for testing homebrew tap


(Hanxue) #1

I am maintaining a Homebrew tap, and I want to use Travis to test the formulae in my tap. I understand that the Homebrew project is now using Jenkins instead.

Looking at the old “.travis.yml”, is there anyway I can repurpose it for my tap?


(Jonathan Chang) #2

The brew tap-new user/repo command should create a tap template that
contains an appropriate .travis.yml file for you to emulate.


(Hanxue) #3

Thanks @jonchang !

The travis config is runnable, but in the log, I don’t see it actually testing any formula

https://travis-ci.org/hanxue/homebrew-cmd/builds/295152643

0.00s==> git -C hanxue/homebrew-cmd clean -ff -dx

Removing Library/

==> PASSED

brew.untap.2
2.00s==> brew untap caskroom/cask

Untapping caskroom/cask... (4,045 files, 80MB)

Untapped 0 formulae

==> PASSED

git.checkout.3
1.00s==> git -C Homebrew checkout master -f

Switched to branch 'master'

==> PASSED

git.reset.4
0.00s==> git -C Homebrew reset --hard origin/master

HEAD is now at 2d5bb029 Merge pull request #3387 from MikeMcQuaid/env-std-homebrew-paths

==> PASSED

Homebrew/brew 1.3.6-148-g2d5bb029 (Merge pull request #3387 from MikeMcQuaid/env-std-homebrew-paths)

Homebrew/homebrew-core cc23516d7 (llnode: drop pointless regex usage)

hanxue/cmd origin/master 

hanxue/cmd HEAD b510fa3 (Use .travis.yml from 'brew tap-new' command)

brew.doctor.5
3.00s==> brew doctor

Your system is ready to brew.

==> PASSED

brew.--env.6
2.00s==> brew --env

export CC="clang"

export CXX="clang\+\+"

export OBJC="clang"

export OBJCXX="clang\+\+"

export HOMEBREW_CC="clang"

export HOMEBREW_CXX="clang\+\+"

export SDKROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk"

export MAKEFLAGS="-j2"

export CMAKE_PREFIX_PATH="/usr/local"

export CMAKE_INCLUDE_PATH="/usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers"

export CMAKE_LIBRARY_PATH="/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries"

export MACOSX_DEPLOYMENT_TARGET="10.12"

export PKG_CONFIG_LIBDIR="/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.12"

export PATH="/usr/local/Homebrew/Library/Homebrew/shims/super:/usr/bin:/bin:/usr/sbin:/sbin"

==> PASSED

brew.config.7
5.00s==> brew config

HOMEBREW_VERSION: 1.3.6-148-g2d5bb02

ORIGIN: https://github.com/Homebrew/brew

HEAD: 2d5bb029a51f17d15ee6a61160297a748c28f6be

Last commit: 11 hours ago

Core tap ORIGIN: https://github.com/Homebrew/homebrew-core

Core tap HEAD: cc23516d7ea2839c6c54439d500910cad4c87a2e

Core tap last commit: 86 minutes ago

HOMEBREW_PREFIX: /usr/local

HOMEBREW_REPOSITORY: /usr/local/Homebrew

HOMEBREW_CELLAR: /usr/local/Cellar

HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com

CPU: dual-core 64-bit nehalem

Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby

Clang: 8.1 build 802

Git: 2.11.0 => /Applications/Xcode.app/Contents/Developer/usr/bin/git

Perl: /usr/bin/perl

Python: /usr/bin/python

Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

Java: 1.8.0_112

macOS: 10.12.5-x86_64

Xcode: 8.3.3

CLT: 8.3.2.0.1.1492020469

X11: 2.7.11 => /opt/X11

==> PASSED

brew.readall.8
2.00s==> brew readall --aliases hanxue/cmd

==> PASSED

brew.install.9
4.00s==> brew install md5deep libyaml

==> Downloading https://homebrew.bintray.com/bottles/md5deep-4.4.sierra.bottle.tar.gz

Already downloaded: /Users/travis/Library/Caches/Homebrew/md5deep-4.4.sierra.bottle.tar.gz

==> Pouring md5deep-4.4.sierra.bottle.tar.gz

/usr/local/Cellar/md5deep/4.4: 20 files, 1.6MB

==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.1.7.sierra.bottle.tar.gz

Already downloaded: /Users/travis/Library/Caches/Homebrew/libyaml-0.1.7.sierra.bottle.tar.gz

==> Pouring libyaml-0.1.7.sierra.bottle.tar.gz

/usr/local/Cellar/libyaml/0.1.7: 8 files, 312.6KB

==> PASSED



The command "brew test-bot" exited with 0.

(Hanxue) #4

Ah, the last reply is a Travis build that does not contain a new formula. Here is the Travis output from a pull request build with a new formula, https://travis-ci.org/hanxue/homebrew-cmd/builds/295230119

The travis run is successful. Does it mean the new Formula is successfully installed and tested (brew test <formula>) in the Travis build environments?

I have not seen any brew install ydcv or brew test ydcv commands in the Travis log above.


(Twlz0ne) #5

I’m Confused about that, too.


EDIT1

My current solution is:

script:
  - brew test-bot;
+ - brew install formula_name
+ - brew test formula_name