travis CI

This commit is contained in:
Lectem 2015-07-12 20:21:05 +02:00
parent f4cef43033
commit 0c2a52a467
3 changed files with 62 additions and 0 deletions

2
.gitignore vendored
View File

@ -5,4 +5,6 @@
Thumbs.db
build/
lib/
docs/
internal_docs
build.sh

47
.travis.yml Normal file
View File

@ -0,0 +1,47 @@
language: c
sudo: false
#Cache devkitArm and doxygen
cache:
directories:
- /home/travis/devkitPro
- /home/travis/doxygen/doxygen-1.8.10/bin
before_install:
# Travis has an OLD doxygen build, so we fetch a recent one
- export DOXY_BINPATH=/home/travis/doxygen/doxygen-1.8.10/bin
- if [ ! -e "$DOXY_BINPATH/doxygen" ]; then mkdir -p ~/doxygen && cd ~/doxygen; fi
- if [ ! -e "$DOXY_BINPATH/doxygen" ]; then wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.10.linux.bin.tar.gz; fi
- if [ ! -e "$DOXY_BINPATH/doxygen" ]; then tar xzf doxygen-1.8.10.linux.bin.tar.gz; fi
- export PATH=$PATH:$DOXY_BINPATH
# Prepare devkitArm update
- export DEVKITPRO=/home/travis/devkitPro
- export DEVKITARM=${DEVKITPRO}/devkitARM
- mkdir -p $DEVKITPRO
- cd $DEVKITPRO
- wget -N http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/devkitARMupdate.pl
-
install:
- cd $DEVKITPRO
# Install or update devkitArm if it's cached
- perl devkitARMupdate.pl
- cd $TRAVIS_BUILD_DIR
env:
global:
- secure: "ENCRYPTED GH_TOKEN HERE"
script:
- cd $TRAVIS_BUILD_DIR/libctru
- make
after_success:
- cd $TRAVIS_BUILD_DIR
- #Build the doxygen files and upload to GH pages
- git config --global user.email "travis@travis-ci.org"
- git config --global user.name "TravisCI-DocBuilder"
# Build the doxygen documentation and push it to gh-pages if current branch is great-refactor
- sh exportdoc.sh

13
exportdoc.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
if [ "$TRAVIS_REPO_SLUG" = "smealum/ctrulib" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "great-refactor" ]; then
git clone --branch=gh-pages --single-branch --depth 1 https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG docs
git rm -rf docs/*
cd libctru
doxygen Doxyfile
mv ./docs/html/* ../docs
cd ../docs
git add --all
git commit -m"Doc generated from commit $TRAVIS_COMMIT"
git push -f origin gh-pages
fi