aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2018-04-24 22:39:43 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2018-04-24 22:39:43 +0300
commit44bab6ea872074ac2cd4de49d2c17fde9cbcc849 (patch)
treec03b7be8ae5c52b20e942dac9d1aebfee60bacd8
parent26e86b73f33dec34b61e06b495da887ff2debeab (diff)
downloadnimpb-44bab6ea872074ac2cd4de49d2c17fde9cbcc849.tar.gz
nimpb-44bab6ea872074ac2cd4de49d2c17fde9cbcc849.zip
Add initial .travis.yml
-rw-r--r--.travis.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..a931e28
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,56 @@
+language: c
+# Run builds with 2 different values of the `nim_branch` environment variable
+env:
+ - nim_branch=master
+ - nim_branch=devel
+# Run builds with 2 different choices of a C compiler
+compiler:
+ - gcc
+ - clang
+# This meams we get a 2x2 build matrix, with a total of 4 builds
+matrix:
+ # It's OK if our project fails to build with Nim devel, but we still want to check it
+ allow_failures:
+ - env: nim_branch=devel
+ # Call the commit successful as soon as the builds with master branch complete.
+ fast_finish: true
+install:
+ - |
+ # Simply replacing "master" with `$nim_branch` everywhere means we can reuse
+ # this installation script for both branches.
+ if [ ! -x nim-$nim_branch/bin/nim ]; then
+ git clone -b $nim_branch --depth 1 git://github.com/nim-lang/nim nim-$nim_branch/
+ cd nim-$nim_branch
+ git clone -b $nim_branch --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-$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:
+ # `$nim_branch` is used here as well, to add the specific compiler to PATH
+ - export PATH="nim-$nim_branch/bin${PATH:+:$PATH}"
+script:
+ # Specify the C compiler to Nim
+ # (the `compiler` option of the build matrix sets the `$CC` variable)
+ - nimble install --cc:$CC https://github.com/oswjk/nimpb_protoc
+ - nimble build --cc:$CC
+ # - nim compile --cc:$CC --verbosity:0
+cache:
+ # Cache both compilers easily
+ directories:
+ - nim-master
+ - nim-devel
+branches:
+ except:
+ - gh-pages