Last active
January 4, 2016 22:09
-
-
Save triblondon/8686330 to your computer and use it in GitHub Desktop.
Sample Travis test to ensure that Origami-compliant modules will build successfully
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script: | |
- "test/travis.rb" | |
language: ruby | |
before_install: | |
- gem install sass | |
- npm install -g bower | |
- npm install -g grunt-cli | |
- npm install | |
- bower install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Create build output directory | |
Dir.mkdir('buildcache') | |
# Perform the build | |
result = `grunt` | |
# Check the exit code was 0 (i.e. no errors) | |
raise result unless $?.to_i == 0 | |
# Check the output of the build | |
raise "When compiled the module should output some CSS" unless File.exists?('buildcache/bundle.css'); | |
raise "When compiled the module should output some JavaScript" unless File.exists?('buildcache/bundle.js'); | |
puts "Build complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note to self: I should rewrite
travis.rb
in Node to make it more accessible...