.travis.yml 3.38 KB
Newer Older
1 2 3 4 5 6 7
language: cpp

compiler:
 - clang
 - gcc

env:
Milo Yip's avatar
Milo Yip committed
8 9 10 11 12
  matrix:
    - config=debug64   config_suffix=debug_x64_gmake
    - config=release64 config_suffix=release_x64_gmake
  global:
    secure: HAEPpA7IxUd+X4X5VcUpSxWf3hDRDNgNpKQrRSX/X/nS0/h5PAwES7fmM6WJAsoEmczCp3OOArzyOON+KLbISvJLnHvnexd+rtyVjU2zOOVTEgzJRdAPHwocqVx5FOxtlKgbDISE6dl3H5aUCycf962jfquhKosi11rbxwcscmc=
13 14 15 16

before_install:
  - sudo add-apt-repository -y ppa:codegear/release
  - sudo apt-get update -qq
Milo Yip's avatar
Milo Yip committed
17
  - sudo apt-get install -y premake4 valgrind
18 19 20 21 22 23 24 25 26

install: true

before_script:
  - cd build 
  - premake4 'gmake'
  - cd "${TRAVIS_BUILD_DIR}"

script:
27
  - make -C build/gmake -f test.make
Milo Yip's avatar
Milo Yip committed
28 29
  - make -C build/gmake -f example.make
  - cd bin
30 31 32
  - ./unittest_${config_suffix}
  - valgrind --leak-check=full --error-exitcode=1 ./unittest_${config_suffix}
  - if [ "$config" = "release64" ]; then ./perftest_${config_suffix}; fi
Milo Yip's avatar
Milo Yip committed
33

Milo Yip's avatar
Milo Yip committed
34
after_success:
Milo Yip's avatar
Milo Yip committed
35
# Build latest doxygen from source
Milo Yip's avatar
Milo Yip committed
36 37 38 39 40 41 42 43 44 45 46 47
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then cd /tmp; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git clone https://github.com/doxygen/doxygen.git; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then cd doxygen; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then ./configure; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then make; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then make distclean; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git pull; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then ./configure; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then make; fi
#  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then sudo make install; fi

# Install doxygen binary distribution 
Milo Yip's avatar
Milo Yip committed
48
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then cd /tmp; fi
Milo Yip's avatar
Milo Yip committed
49
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.7.linux.bin.tar.gz; fi
Milo Yip's avatar
Milo Yip committed
50 51
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then tar -xvf doxygen-1.8.7.linux.bin.tar.gz; fi
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then sudo install -m 755 doxygen-1.8.7/bin/doxygen /usr/bin; fi
Milo Yip's avatar
Milo Yip committed
52 53

# Run doxygen  
Milo Yip's avatar
Milo Yip committed
54
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then cd "${TRAVIS_BUILD_DIR}"; fi
Milo Yip's avatar
Milo Yip committed
55
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then doxygen build/Doxyfile; fi
Milo Yip's avatar
Milo Yip committed
56 57 58 59 60 61 62

# Push to Github Pages
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git config --global user.name "${GIT_NAME}"; fi
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git config --global user.email ${GIT_EMAIL}; fi
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then mkdir build/doc; fi
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then cd build/doc; fi
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git clone https://github.com/miloyip/rapidjson; fi
Milo Yip's avatar
Milo Yip committed
63
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then cd rapidjson; fi
Milo Yip's avatar
Milo Yip committed
64
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git checkout gh-pages; fi
Milo Yip's avatar
Milo Yip committed
65
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then cp -r ../../../doc/html/* .; fi
Milo Yip's avatar
Milo Yip committed
66 67 68
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git add --all; fi
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git commit -m "Automatic doxygen build"; fi
  - if [ "$config" = "release64" -a "$CC" = "clang" ]; then git push https://${GH_TOKEN}@github.com/miloyip/rapidjson gh-pages; fi