nim-wiki/TravisCI.asciidoc

64 lines
1.9 KiB
Plaintext
Raw Normal View History

2015-11-28 16:53:28 +00:00
## Building Nim projects on Travis CI
2015-11-28 16:56:17 +00:00
Building your code on Travis CI is useful to check regressions against the master and devel branches of Nim.
2015-11-28 17:38:24 +00:00
Same for your code documentation.
2015-11-28 16:56:17 +00:00
2016-05-21 23:31:55 +00:00
Detailed guide, which the following example originates from: +
http://blaxpirit.com/blog/22/advanced-uses-of-travis-ci-with-nim.html[Advanced uses of Travis CI with Nim]
2017-02-06 23:54:54 +00:00
If you don't want to rebuild the Nim compiler you can instead install the .deb packages listed on https://github.com/nim-lang/Nim/wiki/CircleCI[CircleCI] using https://docs.travis-ci.com/user/installing-dependencies[this config]
2015-11-28 16:53:28 +00:00
[source,yaml]
----
2015-11-28 16:58:26 +00:00
# Copied from https://github.com/nim-lang/Nim/wiki/TravisCI
2015-11-28 16:53:28 +00:00
language: c
env:
# Build and test against the master and devel branches of Nim
- BRANCH=master
- BRANCH=devel
compiler:
# Build and test using both gcc and clang
- gcc
- clang
matrix:
allow_failures:
# Ignore failures when building against the devel Nim branch
- env: BRANCH=devel
fast_finish: true
install:
- |
if [ ! -x nim-$BRANCH/bin/nim ]; then
git clone -b $BRANCH --depth 1 git://github.com/nim-lang/nim nim-$BRANCH/
cd nim-$BRANCH
2016-12-28 03:18:41 +00:00
git clone --depth 1 git://github.com/nim-lang/csources csources/
2015-11-28 16:53:28 +00:00
cd csources
sh build.sh
cd ..
rm -rf csources
bin/nim c koch
./koch boot -d:release
else
cd nim-$BRANCH
git fetch origin
if ! git merge FETCH_HEAD | grep "Already up-to-date"; then
bin/nim c koch
./koch boot -d:release
fi
fi
cd ..
before_script:
- export PATH="nim-$BRANCH/bin${PATH:+:$PATH}"
script:
2015-11-28 17:38:24 +00:00
# Replace uppercase strings!
- nim c --cc:$CC --verbosity:0 -r MYFILE.nim
# Optional: build docs.
- nim doc --docSeeSrcUrl:https://github.com/AUTHOR/MYPROJECT/blob/master --project MYFILE.nim
2015-11-28 16:53:28 +00:00
cache:
directories:
- nim-master
- nim-devel
branches:
except:
- gh-pages
2016-03-09 14:30:29 +00:00
----