Skip to content

Commit

Permalink
Add AppVeyor continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris00 committed Nov 22, 2015
1 parent fba5967 commit 68ef535
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
32 changes: 32 additions & 0 deletions appveyor.yml
@@ -0,0 +1,32 @@
# http://www.appveyor.com/docs/appveyor-yml

# Use 'unstable' build worker image as it contains Cygwin
os: Unstable

branches:
only:
- master
except:
- gh-pages

environment:
global:
CYG_ROOT: C:/cygwin
CYG_CACHE: C:/cygwin/var/cache/setup
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
OPAM_DIR: C:/opam

cache:
- C:\opam

install:
- set PATH=%OPAM_DIR%\bin;%PATH%
# - appveyor DownloadFile "http://cygwin.com/setup-%CYG_ARCH%.exe" -FileName "%CYG_ROOT%\setup-x86.exe"
- '"%CYG_ROOT%\setup-x86.exe" -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P make -P gcc-core -P ocaml -P ocaml-compiler-libs -P m4 -P tar -P patch -P flexdll -P pcre >NUL'
- '%CYG_ROOT%\bin\bash -lc "cygcheck -dc cygwin"'
- '%CYG_ROOT%\bin\bash -lc "echo \"OCaml version `ocamlc -version`\""'
- appveyor_install.cmd

build_script:
- 'echo Build in "%APPVEYOR_BUILD_FOLDER%"'
- '%CYG_ROOT%/bin/bash -l "%APPVEYOR_BUILD_FOLDER%/appveyor_build.sh"'
14 changes: 14 additions & 0 deletions appveyor_build.sh
@@ -0,0 +1,14 @@
#!/bin/bash

cd "$APPVEYOR_BUILD_FOLDER"

echo "Initialize OPAM..."
opam init -y -a
opam install -y ocamlfind ocaml-data-notation ocamlmod ocamlify
eval $(opam config env)
export OCAML_TOPLEVEL_PATH=$(opam config var toplevel)

echo "Compile OASIS..."
ocaml setup.ml -configure
ocaml setup.ml -build

11 changes: 11 additions & 0 deletions appveyor_install.cmd
@@ -0,0 +1,11 @@
REM Environment variables set in appveyor.yml

if not exist %OPAM_DIR%\bin\opam.exe (
echo Compiling opam to %OPAM_DIR% ...
mkdir "%OPAM_DIR%"
git clone https://github.com/ocaml/opam.git C:\temp\opam
%CYG_ROOT%\bin\bash -lc "cd \"/cygdrive/c/temp/opam\" && env DJDIR=workaround ./configure --prefix=%OPAM_DIR% && make lib-ext && make && make install"
goto :endopam
)
echo Using %OPAM_DIR%\bin\opam.exe ...
:endopam

0 comments on commit 68ef535

Please sign in to comment.