.gitlab-ci.yml 2.56 KB
Newer Older
1
image: oarteam/batsim_ci:2017-05-25
2

3
4
5
variables:
  GIT_SUBMODULE_STRATEGY: normal

Millian Poquet's avatar
Millian Poquet committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# The before_script part above is done in order to push Batsim's code doc
# onto the gforge website.
# Information found on https://docs.gitlab.com/ee/ci/ssh_keys/README.html
before_script:
  # Install ssh-agent if not already installed, it is required by Docker.
  # (change apt-get to yum if you use a CentOS-based image)
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'

  # Run ssh-agent (inside the build environment)
  - eval $(ssh-agent -s)

  # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
  - ssh-add <(echo "$SSH_PRIVATE_KEY")

  # For Docker builds disable host key checking. Be aware that by adding that
  # you are suspectible to man-in-the-middle attacks.
  # WARNING: Use this only with the Docker executor, if you use it with shell
  # you will overwrite your user's SSH config.
  - mkdir -p ~/.ssh
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'

Millian Poquet's avatar
Millian Poquet committed
27
build_clang:
Michael Mercier's avatar
Michael Mercier committed
28
29
  stage: build
  script:
30
31
    - export CC=/usr/bin/clang
    - export CXX=/usr/bin/clang++
Millian Poquet's avatar
Millian Poquet committed
32
33
    - mkdir /builds/batsim/batsim/build
    - cd /builds/batsim/batsim/build
34
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -Dtreat_warnings_as_errors=ON
35
    - make
36
  artifacts:
37
    paths:
38
      - /builds/batsim/batsim/build
Michael Mercier's avatar
Michael Mercier committed
39

Millian Poquet's avatar
Millian Poquet committed
40
build_batsched:
41
  stage: build
42
  script:
43
44
45
46
    - cd /builds/batsim/batsim/schedulers
    - mkdir batsched_build
    - cd batsched_build
    - cmake /builds/batsim/batsim/schedulers/batsched
47
48
49
    - make
  artifacts:
    paths:
50
      - /builds/batsim/batsim/schedulers/batsched_build
51

Millian Poquet's avatar
Millian Poquet committed
52
test_doc:
Millian Poquet's avatar
Millian Poquet committed
53
  stage: test
54
  script:
Millian Poquet's avatar
Millian Poquet committed
55
    - cd /builds/batsim/batsim/doc
56
57
58
59
60
61
    - doxygen
    - cat doxygen_warnings.log
    # The next line fails if doxygen generated warnings
    - eval "[ $(wc -c doxygen_warnings.log | cut -d ' ' -f1) -eq 0 ]"
  artifacts:
    paths:
Millian Poquet's avatar
Millian Poquet committed
62
      - /builds/batsim/batsim/doc/doxygen_doc/html
63

Millian Poquet's avatar
Millian Poquet committed
64
test_test:
Michael Mercier's avatar
Michael Mercier committed
65
66
  stage: test
  script:
Michael Mercier's avatar
Michael Mercier committed
67
68
69
70
71
    # Let's run the redis server
    - |
      redis-server>/dev/null &
      while ! nc -z localhost 6379; do
        sleep 1
72
      done
Michael Mercier's avatar
Michael Mercier committed
73

74
    - cd /builds/batsim/batsim/build
75
    - make install
76

77
    - cd /builds/batsim/batsim/schedulers/batsched_build
78
79
80
    - make install

    - cd /builds/batsim/batsim/build
81
    - ctest --output-on-failure -E remote
82
  dependencies:
Millian Poquet's avatar
Millian Poquet committed
83
84
    - build_clang
    - build_batsched
Millian Poquet's avatar
Millian Poquet committed
85
86
87
88

deploy_code_doc:
  stage: deploy
  script:
Millian Poquet's avatar
Millian Poquet committed
89
    - cd /builds/batsim/batsim/doc
Millian Poquet's avatar
Millian Poquet committed
90
91
    - rsync -rlgoDz --delete doxygen_doc/html/ mpoquet@scm.gforge.inria.fr:/home/groups/batsim/htdocs
  dependencies:
Millian Poquet's avatar
Millian Poquet committed
92
    - test_doc