image: nitlang/nit-ci
+ services:
+ - mongo
+ - neo4j:2.3
+ - postgres
+
+ variables:
+ NEO4J_AUTH: none
+
cache:
paths:
- .ccache
+ - .gradle/caches
+ - .gradle/wrapper
key: "$CI_JOB_NAME"
stages:
before_script:
- date
- export CCACHE_DIR=$PWD/.ccache
+ - export GRADLE_USER_HOME=$PWD/.gradle
- export PATH=$PWD/bin:$PATH
- pwd
- ccache -s
- ccache -M 500M
+ - du -sh .gradle || true
- type -a nitc nitdoc || true # is there some nit tools?
- "> status.txt"
after_script:
- export CCACHE_DIR=$PWD/.ccache
- ccache -s
+ - du -sh .gradle || true
- git status --ignored
- date
- tail status.txt
dependencies:
- build_tools
script:
- - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt
+ - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt || true
- xargs nitls -pP < list0.txt > list.txt
- xargs nitunit < list.txt
artifacts:
- build_tools
script:
- nitls lib src examples contrib
- - nitls -Pp lib src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+ - nitls -Pp lib src examples | grep -v -f tests/gitlab_ci.skip > list.txt || true # filter what is skipped by tests.sh
- xargs nitpick < list.txt
+basic_android:
+ stage: test
+ dependencies:
+ - build_tools
+ script:
+ - make -C contrib/asteronits android
+ artifacts:
+ paths:
+ - contrib/asteronits/bin/*.apk
+
# TEST FULL #########################################################
test_full_nitcs:
dependencies:
- build_tools
script:
- - nitls -Pp lib | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+ - nitls -Pp lib | grep -v -f tests/gitlab_ci.skip > list.txt || true # filter what is skipped by tests.sh
- xargs nitunit -v < list.txt| tee log.txt
- grep -e KO log.txt > status.txt || true
- tail -3 log.txt >> status.txt
dependencies:
- build_tools
script:
- - nitls -Pp src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+ - nitls -Pp src examples | grep -v -f tests/gitlab_ci.skip > list.txt || true # filter what is skipped by tests.sh
- xargs nitunit -v < list.txt| tee log.txt
- grep -e KO log.txt > status.txt || true
- tail -3 log.txt >> status.txt
- test ! -s status.txt # no lines, no errors
allow_failure: true
+test_contribs_android:
+ stage: more_test
+ dependencies:
+ - build_tools
+ script:
+ - misc/jenkins/check_contrib.sh android
+ - grep 'error message' *.xml > status.txt || true
+ - mkdir -p apk
+ - find . -name '*.apk' -exec cp {} apk/ ";"
+ - test ! -s status.txt # no lines, no errors
+ artifacts:
+ paths:
+ - "apk"
+ when: always
+
build_oot:
stage: more_test
dependencies:
# Neo4j connector through its JSON REST API using curl.
#
# In order to connect to Neo4j you need a connector:
#
# # Create new Neo4j client
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
# assert client.is_ok
#
# The fundamental units that form a graph are nodes and relationships.
import curl_json
import error
- # Handles Neo4j server start and stop command
- #
- # `neo4j` binary must be in `PATH` in order to work
- class Neo4jServer
-
- # Start the local Neo4j server instance
- fun start: Bool do
- sys.system("neo4j start console")
- return true
- end
-
- # Like `start` but redirect the console output to `/dev/null`
- fun start_quiet: Bool do
- sys.system("neo4j start console > /dev/null")
- return true
- end
-
- # Stop the local Neo4j server instance
- fun stop: Bool do
- sys.system("neo4j stop")
- return true
- end
-
- # Like `stop` but redirect the console output to `/dev/null`
- fun stop_quiet: Bool do
- sys.system("neo4j stop > /dev/null")
- return true
- end
- end
-
# `Neo4jClient` is needed to communicate through the REST API
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
# assert client.is_ok
class Neo4jClient
# REST service to send cypher requests
private var cypher_url: String
- private var curl = new Curl
-
init(base_url: String) do
self.base_url = base_url
var root = service_root
# Save the node in base
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
#
# # Create a node
# var andres = new NeoNode
# Save the edge in base
# From and to nodes will be created.
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
#
# var andres = new NeoNode
# var kate = new NeoNode
# Retrieve all nodes with specified `lbl`
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
#
# var andres = new NeoNode
# andres.labels.add_all(["Human", "Male"])
# Retrieve nodes belonging to all the specified `labels`.
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
#
# var andres = new NeoNode
# andres.labels.add_all(["Human", "Male"])
#
# Example:
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
# var query = new CypherQuery
# query.nmatch("(n)-[r:LOVES]->(m)")
# query.nwhere("n.name=\"Andres\"")
# Then we can link the entity to the base:
#
# # Init client
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
# client.save_node(andres)
# # The node is now linked
# assert andres.is_linked
#
# Creating new nodes:
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
#
# var andres = new NeoNode
# andres.labels.add "Person"
#
# Create a relationship:
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
# # Create nodes
# var andres = new NeoNode
# andres["name"] = "Andres"
#
# Example:
#
- # var client = new Neo4jClient("http://localhost:7474")
+ # var client = new Neo4jClient("http://neo4j:7474")
#
# var node1 = new NeoNode
# var node2 = new NeoNode
# This is a representation of a neo job in JSON Format
#
# Each job description should contain a `to` attribute, with a value relative to the data API root
- # (so http://localhost:7474/db/data/node becomes just /node), and a `method` attribute containing
+ # (so http://neo4j:7474/db/data/node becomes just /node), and a `method` attribute containing
# HTTP verb to use.
#
# Optionally you may provide a `body` attribute, and an `id` attribute to help you keep track
libsqlite3-dev \
libx11-dev \
libxdg-basedir-dev \
- postgresql \
+ netcat \
+ psmisc \
# Packages needed for contrib, platforms and FFI
ant \
clang \
file \
gnupg \
gnuplot-nox \
+ imagemagick \
inkscape \
libopenmpi-dev \
time \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
+# Install OpenGL validator
+RUN git clone https://github.com/KhronosGroup/glslang.git --depth=1 \
+ && mkdir -p glslang/build \
+ && cd glslang/build \
+ && cmake .. \
+ && make \
+ && make install
+
+# Install android sdk/ndk
+RUN mkdir -p /opt \
+ && cd /opt \
+ # Android SDK
+ && curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -o android-sdk-linux.zip \
+ && unzip -q android-sdk-linux.zip -d android-sdk-linux \
+ # Download a specific ndk version because old versions are not available trough sdkmanager
+ && curl https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip -o android-ndk-linux.zip \
+ && unzip -q android-ndk-linux.zip \
+ && mv android-ndk-r17c android-sdk-linux/ndk-bundle \
+ && rm android-sdk-linux.zip android-ndk-linux.zip
+RUN cd /opt \
+ && yes | android-sdk-linux/tools/bin/sdkmanager "build-tools;27.0.0" "cmake;3.6.4111459" platform-tools tools --verbose\
+ && yes | android-sdk-linux/tools/bin/sdkmanager --licenses --verbose
+# TODO: predownload bwdgc and gradle?
+
# Setup environment variables
+ENV ANDROID_HOME=/opt/android-sdk-linux/
ENV JAVA_HOME=/usr/lib/jvm/default-java/
ENV JNI_LIB_PATH=$JAVA_HOME/jre/lib/amd64/server/
ENV LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server/
+# Used by CI to render junit files to html
RUN pip3 install junit2html
# Prepare to install npm (npm is not packaged for debian:stretch)