Backport CI setup to 0.4 branch
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/0fdd4e39 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/0fdd4e39 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/0fdd4e39 Branch: refs/heads/0.4 Commit: 0fdd4e39d57c1bc7a2005be8f345a67958f75d07 Parents: 1aecf7a Author: Nick Wellnhofer <[email protected]> Authored: Fri Jul 24 21:00:13 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Fri Jul 24 21:52:11 2015 +0200 ---------------------------------------------------------------------- .travis.yml | 25 +++++++++------ appveyor.yml | 17 ++++++++++ devel/bin/appveyor-build.bat | 41 ++++++++++++++++++++++++ devel/bin/travis-test.sh | 66 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 139 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/0fdd4e39/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index e746958..4e6c245 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,14 +14,19 @@ # limitations under the License. language: perl -perl: - - "5.19" - - "5.18" - - "5.16" - - "5.14" - - "5.12" - - "5.10" - - "5.8" -before_install: - - cd perl +sudo: required +# Override Travis' default Perl installation script. +install: 'true' +script: devel/bin/travis-test.sh +env: + - LUCY_DEBUG=1 CLOWNFISH_HOST=c + - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.20 + - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.18 + - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.16 + - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.14 + - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.12 + - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.10 + - LUCY_DEBUG=1 CLOWNFISH_HOST=perl PERL_VERSION=5.8 +git: + depth: 10 http://git-wip-us.apache.org/repos/asf/lucy/blob/0fdd4e39/appveyor.yml ---------------------------------------------------------------------- diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..c153317 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,17 @@ +environment: + global: + LUCY_DEBUG: 1 + matrix: + - CLOWNFISH_HOST: c + MSVC_VERSION: 10 + - CLOWNFISH_HOST: c + MSVC_VERSION: 12 +# - CLOWNFISH_HOST: perl + +build: off + +test_script: + - 'devel\bin\appveyor-build.bat' + +clone_depth: 10 + http://git-wip-us.apache.org/repos/asf/lucy/blob/0fdd4e39/devel/bin/appveyor-build.bat ---------------------------------------------------------------------- diff --git a/devel/bin/appveyor-build.bat b/devel/bin/appveyor-build.bat new file mode 100644 index 0000000..c0d7f5f --- /dev/null +++ b/devel/bin/appveyor-build.bat @@ -0,0 +1,41 @@ +@echo off + +if "%CLOWNFISH_HOST%" == "c" goto test_c +if "%CLOWNFISH_HOST%" == "perl" goto test_perl + +echo unknown CLOWNFISH_HOST: %CLOWNFISH_HOST% +exit /b 1 + +:test_c + +if "%MSVC_VERSION%" == "10" goto msvc_10 + +call "C:\Program Files (x86)\Microsoft Visual Studio %MSVC_VERSION%.0\VC\vcvarsall.bat" amd64 +goto msvc_build + +:msvc_10 +call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 + +:msvc_build + +rem Install Clownfish. +cd \projects +git clone -q -b 0.4 --depth 1 https://git-wip-us.apache.org/repos/asf/lucy-clownfish.git +cd lucy-clownfish\runtime\c +call configure && nmake || exit /b +call install --prefix C:\install + +cd \projects\lucy\c +call configure --clownfish-prefix=C:\install && nmake && nmake test + +exit /b + +:test_perl + +perl -V + +cd perl +perl Build.PL && call Build && call Build test + +exit /b + http://git-wip-us.apache.org/repos/asf/lucy/blob/0fdd4e39/devel/bin/travis-test.sh ---------------------------------------------------------------------- diff --git a/devel/bin/travis-test.sh b/devel/bin/travis-test.sh new file mode 100755 index 0000000..65d0b2d --- /dev/null +++ b/devel/bin/travis-test.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Exit if any command returns non-zero. +set -e + +# Print all commands before executing. +set -x + +test_c() { + # Install Clownfish. + git clone -q -b 0.4 --depth 1 https://git-wip-us.apache.org/repos/asf/lucy-clownfish.git + cd lucy-clownfish/runtime/c + ./configure + make -j + sudo ./install.sh --prefix /usr/local + sudo ldconfig + + cd ../../../c + ./configure + make -j test +} + +test_perl() { + perlbrew switch $PERL_VERSION + + # Install Clownfish. + git clone -q -b 0.4 --depth 1 https://git-wip-us.apache.org/repos/asf/lucy-clownfish.git + cd lucy-clownfish/runtime/perl + perl Build.PL + ./Build + sudo ./Build install + cd ../../compiler/perl + sudo ./Build install + + cd ../../../perl + perl Build.PL + ./Build test +} + +case $CLOWNFISH_HOST in + perl) + test_perl + ;; + c) + test_c + ;; + *) + echo "unknown CLOWNFISH_HOST: $CLOWNFISH_HOST" + exit 1 +esac +
