]> code.delx.au - gnu-emacs-elpa/commitdiff
Change Emacs installation method for Travis CI
authorNoam Postavsky <github.10.npostavs@spamgourmet.com>
Sun, 24 Apr 2016 21:29:05 +0000 (17:29 -0400)
committerNoam Postavsky <github.10.npostavs@spamgourmet.com>
Sun, 24 Apr 2016 21:29:05 +0000 (17:29 -0400)
* .travis.yml: Don't use sudo, submodules.
(env): Test with additional Emacs versions.
(install): Get Emacs binaries from
https://github.com/npostavs/emacs-travis/releases.  Download ert and
cl-lib if needed.
(script): Split compilation and testing into separate steps.
* Rakefile: Use batch-byte-compile.  Treat compilation warnings as
errors.

.travis.yml
Rakefile

index 4bd79405d994edc1c4fc5adc1ecdbd2a8ca77a80..72aa314ba91ef2895eaa17ca7251b987ee8872a2 100644 (file)
@@ -1,24 +1,28 @@
-language: emacs
+language: generic
+sudo: false
+git:
+  submodules: false
 
 env:
-  - "EMACS=emacs23"
-  - "EMACS=emacs24"
+  - EMACS_VERSION=23.4
+  - EMACS_VERSION=24.3
+  - EMACS_VERSION=24.5
+  - EMACS_VERSION=25-prerelease
 
 install:
-  - if [ "$EMACS" = "emacs23" ]; then
-        sudo apt-get -qq update &&
-        sudo apt-get -qq -f install &&
-        sudo apt-get -qq install emacs23-nox &&
-        curl -LO https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el &&
-        curl -LO https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert-x.el &&
-        curl -Lo cl-lib.el http://elpa.gnu.org/packages/cl-lib-0.5.el;
+  - curl -LO https://github.com/npostavs/emacs-travis/releases/download/bins/emacs-bin-${EMACS_VERSION}.tar.gz
+  - tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C /
+  # Configure $PATH: Emacs installed to /tmp/emacs
+  - export PATH=/tmp/emacs/bin:${PATH}
+  - if ! emacs -Q --batch --eval "(require 'cl-lib)" ; then
+        curl -Lo cl-lib.el http://elpa.gnu.org/packages/cl-lib-0.5.el ;
     fi
-  - if [ "$EMACS" = "emacs24" ]; then
-        sudo add-apt-repository -y ppa:cassou/emacs &&
-        sudo apt-get -qq update &&
-        sudo apt-get -qq -f install &&
-        sudo apt-get -qq install emacs24-nox;
+  - if ! emacs -Q --batch --eval "(require 'ert)" ; then
+        curl -LO https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el &&
+        curl -LO https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert-x.el ;
     fi
+  - emacs --version
 
 script:
-  - rake compile; rake tests
+  - rake compile
+  - rake tests
index 2965eb9d5ba5a7699cb4a23e34901a26a8b406c4..9986b7568dc15b44f92f72a01097ed9b86ff4651 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -94,7 +94,8 @@ end
 desc "Compile yasnippet.el into yasnippet.elc"
 
 rule '.elc' => '.el' do |t|
-  sh "#{$EMACS} --batch -L . --eval \"(byte-compile-file \\\"#{t.source}\\\")\""
+  sh "#{$EMACS} --batch -L . --eval \"(setq byte-compile-error-on-warn t)\"" +
+     " -f batch-byte-compile #{t.source}"
 end
 task :compile => FileList["yasnippet.el"].ext('elc')