diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..b30a08ad --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.bundle +vendor +ci/Dockerfile diff --git a/.gitignore b/.gitignore index 95ae026c..c28cba18 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ unzip coverage .yardoc coverage.data +vendor *.gem *.xlsx example.csv @@ -18,4 +19,4 @@ examples/sprk2012 .~lock* *.qcachegrind *.iml -.idea \ No newline at end of file +.idea diff --git a/.travis.yml b/.travis.yml index 75643824..919e8d41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,11 +25,15 @@ matrix: - rvm: ruby-head - rvm: jruby-head env: JRUBY_OPTS="-Xcli.debug=true --debug" + - services: docker + before_install: docker build . -f ci/Dockerfile -t axlsx + script: docker run axlsx ci/validate-xlsx-files.sh allow_failures: - rvm: rbx-3 - rvm: ruby-head - rvm: jruby-9.1.8.0 - rvm: jruby-head + - services: docker # https://github.com/jruby/jruby/wiki/FAQs#why-is-jruby-so-slow-to-install-via-rvm # https://docs.travis-ci.com/user/installing-dependencies#Installing-Packages-with-the-APT-Addon diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 00000000..4f494fef --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,13 @@ +# vim: set ft=Dockerfile + +FROM vindvaki/xlsx-validator + +RUN apt-get install -y build-essential ruby ruby-dev libxslt-dev libxml2-dev zlib1g-dev +RUN gem install bundler +ADD Gemfile* axlsx.gemspec /app/axlsx/ +WORKDIR /app/axlsx/ +ADD lib/axlsx/version.rb lib/axlsx/version.rb +RUN bundle install +ADD . . + +ADD ci/validate-xlsx-files.sh . diff --git a/ci/validate-xlsx-files.sh b/ci/validate-xlsx-files.sh new file mode 100755 index 00000000..e68e2120 --- /dev/null +++ b/ci/validate-xlsx-files.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +bundle exec ruby examples/example.rb +xlsx-validator *.xlsx