Browse Source

[TravisCI] improve config readability

Andy Li 10 years ago
parent
commit
f925d426d0
2 changed files with 33 additions and 9 deletions
  1. 31 7
      .travis.yml
  2. 2 2
      tests/RunCi.hx

+ 31 - 7
.travis.yml

@@ -6,6 +6,10 @@ os:
 
 env:
   global:
+    # make variables
+    - OCAMLC=ocamlc.opt
+    - OCAMLOPT=ocamlopt.opt
+    - ADD_REVISION=1
     # SAUCE_USERNAME
     - secure: SjyKefmjUEXi0IKHGGpcbLAajU0mLHONg8aA8LoY7Q9nAkSN6Aql+fzS38Boq7w1jWn+2FOpr+4jy0l6wVd/bftsF+huFfYpFJmdh8BlKmE0K71zZAral0H1c7YxkuQpPiJCIFGXqtkvev7SWTy0z31u7kuuQeEyW27boXe5cDA=
     # SAUCE_ACCESS_KEY
@@ -27,17 +31,37 @@ matrix:
   # fast_finish: true #https://github.com/travis-ci/travis-ci/issues/1696
 
 before_script:
-  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then mysql -u root -e "CREATE DATABASE haxe_test;"; fi
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
+    mysql -u root -e "CREATE DATABASE haxe_test;";
+    fi
 
 install:
-  - if [ -z "${TRAVIS_OS_NAME}" ]; then export TRAVIS_OS_NAME=linux; fi; # for our forks that do not have mult-os enabled.
-  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then travis_retry sudo apt-get update -qq; travis_retry sudo apt-get install ocaml-native-compilers zlib1g-dev libgc-dev -qq; fi
-  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then travis_retry brew update; travis_retry brew install caskroom/cask/brew-cask; travis_retry brew install ocaml camlp4; fi
-  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then travis_retry git clone https://github.com/HaxeFoundation/neko.git ~/neko && cd ~/neko && make os=${TRAVIS_OS_NAME} -s && sudo make install -s && cd $TRAVIS_BUILD_DIR; fi
-  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then travis_retry brew install neko --HEAD; fi
+  # For our forks that do not have mult-os enabled...
+  - if [ -z "${TRAVIS_OS_NAME}" ]; then
+    export TRAVIS_OS_NAME=linux;
+    fi
+  # Install haxe and neko dependencies
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
+    travis_retry sudo apt-get update -qq;
+    travis_retry sudo apt-get install ocaml-native-compilers zlib1g-dev libgc-dev -qq;
+    fi
+  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+    travis_retry brew update;
+    travis_retry brew install caskroom/cask/brew-cask;
+    travis_retry brew install ocaml camlp4;
+    fi
+  # Install neko
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
+    travis_retry git clone https://github.com/HaxeFoundation/neko.git ~/neko;
+    cd ~/neko && make os=${TRAVIS_OS_NAME} -s && sudo make install -s;
+    cd $TRAVIS_BUILD_DIR;
+    fi
+  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+    travis_retry brew install neko --HEAD;
+    fi
 
 script:
-  - make OCAMLOPT=ocamlopt.opt ADD_REVISION=1 -s
+  - make -s
   - make tools -s
   - sudo make install -s
   - cd tests/

+ 2 - 2
tests/RunCi.hx

@@ -548,14 +548,14 @@ class RunCi {
 							//pass
 						case TravisCI:
 							changeDirectory(repoDir);
-							runCommand("make", ["BYTECODE=1", "OCAMLOPT=ocamlopt.opt", "ADD_REVISION=1", "-s"]);
+							runCommand("make", ["BYTECODE=1", "-s"]);
 							runCommand("sudo", ["make", "install", "-s"]);
 							changeDirectory(unitDir);
 							runCommand("haxe", ["compile-macro.hxml"]);
 						case AppVeyor:
 							// save time...
 							// changeDirectory(repoDir);
-							// runCommand(Sys.getEnv("CYG_ROOT") + "/bin/bash", ["-lc", 'cd \"$$OLDPWD\" && make -s -f Makefile.win WODI=wodi${Sys.getEnv("WODI_ARCH")} OCAMLC=ocamlc.opt ADD_REVISION=1 BYTECODE=1']);
+							// runCommand(Sys.getEnv("CYG_ROOT") + "/bin/bash", ["-lc", 'cd \"$$OLDPWD\" && make -s -f Makefile.win BYTECODE=1']);
 							// changeDirectory(unitDir);
 							// runCommand("haxe", ["compile-macro.hxml"]);
 					}