diff --git a/.gitignore b/.gitignore index 0ebdc291..3a9626a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.m~ mym/ *.mltbx -*.env \ No newline at end of file +*.env diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..4d85d5d9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +sudo: required +services: +- docker +env: + global: + - DOCKER_CLIENT_TIMEOUT: 120 + - COMPOSE_HTTP_TIMEOUT: 120 + - MATLAB_USER: muser + - MATLAB_UID: 2000 + - MATLAB_GID: 2000 +slim: &slim + stage: Slim9.9 + os: linux + language: shell + script: + - license=MATLAB_LICENSE_${MATLAB_VERSION} + - export MATLAB_LICENSE=$(eval echo "\$$license") + - docker-compose -f LNX-docker-compose.yml up --exit-code-from dj +jobs: + include: + - <<: *slim + env: + - MATLAB_VERSION: R2018b + - MYSQL_TAG: 8.0 + - <<: *slim + env: + - MATLAB_VERSION: R2018b + - MYSQL_TAG: 5.7 + - <<: *slim + env: + - MATLAB_VERSION: R2018b + - MYSQL_TAG: 5.6 \ No newline at end of file diff --git a/LNX-docker-compose.yml b/LNX-docker-compose.yml new file mode 100644 index 00000000..42897e1a --- /dev/null +++ b/LNX-docker-compose.yml @@ -0,0 +1,43 @@ +# docker-compose -f LNX-docker-compose.yml --env-file LNX.env up --build --exit-code-from dj +version: '2.2' +x-net: &net + networks: + - main +services: + dj: + <<: *net + environment: + - DISPLAY + - MATLAB_LICENSE + - MATLAB_USER + - DJ_HOST=mysql + - DJ_USER=root + - DJ_PASS=simple + - DJ_TEST_HOST=mysql + - DJ_TEST_USER=datajoint + - DJ_TEST_PASSWORD=datajoint + image: raphaelguzman/matlab:${MATLAB_VERSION}-MIN + depends_on: + mysql: + condition: service_healthy + user: ${MATLAB_UID}:${MATLAB_GID} + working_dir: /src + command: > + /bin/bash -c " + matlab -nodisplay -r \"\ + res=run(tests.Main);\ + disp(res);\ + if all([res.Passed]) exit, else exit(1), end;\ + \"; + " + mac_address: $MATLAB_HOSTID + volumes: + - .:/src + - /tmp/.X11-unix:/tmp/.X11-unix:rw + mysql: + <<: *net + image: datajoint/mysql:${MYSQL_TAG} + environment: + - MYSQL_ROOT_PASSWORD=simple +networks: + main: \ No newline at end of file