92 lines
2.5 KiB
Plaintext
92 lines
2.5 KiB
Plaintext
## Building Nim projects on Circle CI
|
|
|
|
Building your code on Circle CI is useful to check regressions against the master and devel branches of Nim.
|
|
Same for your code documentation.
|
|
|
|
Configure the build:
|
|
|
|
Under Test Commands >> Dependency Commands >> Pre-dependency commands:
|
|
[source,sh]
|
|
----
|
|
wget http://http.us.debian.org/debian/pool/main/n/nim/nim_0.16.0-1_amd64.deb
|
|
wget http://http.us.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2k-1_amd64.deb
|
|
sudo dpkg -i *_amd64.deb
|
|
----
|
|
|
|
Under Test Commands >> Test Commands >> Test Commands:
|
|
[source,sh]
|
|
----
|
|
# This will fetch Nimble dependencies
|
|
nimble build -y
|
|
nim c -r <mytest.nim>
|
|
----
|
|
|
|
Be aware that the available .deb packages will change over time.
|
|
|
|
|
|
## Building Nim projects on Travis CI
|
|
|
|
Building your code on Travis CI is useful to check regressions against the master and devel branches of Nim.
|
|
Same for your code documentation.
|
|
|
|
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]
|
|
|
|
If you don't want to rebuild the Nim compiler you can instead install the .deb packages listed on the CircleCI guide above using https://docs.travis-ci.com/user/installing-dependencies[this config]
|
|
|
|
[source,yaml]
|
|
----
|
|
# Copied from https://github.com/nim-lang/Nim/wiki/TravisCI
|
|
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
|
|
git clone --depth 1 git://github.com/nim-lang/csources csources/
|
|
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:
|
|
# 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
|
|
cache:
|
|
directories:
|
|
- nim-master
|
|
- nim-devel
|
|
branches:
|
|
except:
|
|
- gh-pages
|
|
|
|
----
|
|
|