Skip to content
Snippets Groups Projects
.gitlab-ci.yml 16.63 KiB
image: node

stages:
  - build
  - packaging
  - test

variables:
  POSTGRES_DB: map_viewer
  POSTGRES_USER: map_viewer
  POSTGRES_PASSWORD: "123qweasdzxc"

test_frontend:
  stage: test
  coverage: '/Statements[:\ ]+(\d+.\d+)\%/'
  script:
    - cd frontend-js
    - npm install  
    - npm test

test_backend 1 15:
  image: maven:3.6.0-jdk-8
  stage: test
  coverage: '/(\d+.\d+) \% covered/'
  script:
#xvfb is for X11 connection used by some parts of the java code: https://stackoverflow.com/a/47575851/1127920
    - apt-get update
    - DEBIAN_FRONTEND=noninteractive apt-get install -y xvfb
    - Xvfb :99 &
    - export DISPLAY=:99

    - mvn -DskipTests=true clean install -pl commons -am
    - mvn test -pl commons
    - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions,"% covered" }' commons/target/site/jacoco/jacoco.csv

test_backend 2 15:
  image: maven:3.6.0-jdk-8
  services:
    - postgres:9.6
  stage: test
  coverage: '/(\d+.\d+) \% covered/'
  script:
    - mkdir /etc/minerva/
    - cp test-db-ci.properties /etc/minerva/db.properties

    - mvn -DskipTests=true clean install -pl annotation -am
    - mvn test -pl annotation
    - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions,"% covered" }' annotation/target/site/jacoco/jacoco.csv

test_backend 3 15:
  image: maven:3.6.0-jdk-8
  stage: test
  coverage: '/(\d+.\d+) \% covered/'
  script:
#xvfb is for X11 connection used by some parts of the java code: https://stackoverflow.com/a/47575851/1127920
    - apt-get update
    - apt-get install -y xvfb
    - Xvfb :99 &
    - export DISPLAY=:99

    - mvn -DskipTests=true clean install -pl CellDesigner-plugin -am
    - mvn test -pl CellDesigner-plugin
    - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, "instructions covered"; print 100*covered/instructions,"% covered" }' CellDesigner-plugin/target/site/jacoco/jacoco.csv

test_backend 4 15:
  image: maven:3.6.0-jdk-8
  stage: test
  coverage: '/(\d+.\d+) \% covered/'
  script:
    - mvn -DskipTests=true clean install -pl converter -am