.gitlab-ci.yml 2.82 KB
Newer Older
Millian Poquet's avatar
Millian Poquet committed
1
image: oarteam/batsim_ci:2017-09-12
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'

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

build_gcc:
Michael Mercier's avatar
Michael Mercier committed
41
42
  stage: build
  script:
Millian Poquet's avatar
Millian Poquet committed
43
44
    - export CC=/usr/bin/gcc
    - export CXX=/usr/bin/g++
Millian Poquet's avatar
Millian Poquet committed
45
46
    - mkdir /builds/batsim/batsim/build
    - cd /builds/batsim/batsim/build
47
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -Dtreat_warnings_as_errors=ON
48
    - make
Michael Mercier's avatar
Michael Mercier committed
49

Millian Poquet's avatar
Millian Poquet committed
50
build_batsched:
51
  stage: build
52
  script:
53
54
55
56
    - cd /builds/batsim/batsim/schedulers
    - mkdir batsched_build
    - cd batsched_build
    - cmake /builds/batsim/batsim/schedulers/batsched
57
58
59
    - make
  artifacts:
    paths:
60
      - /builds/batsim/batsim/schedulers/batsched_build
61

Millian Poquet's avatar
Millian Poquet committed
62
test_doc:
Millian Poquet's avatar
Millian Poquet committed
63
  stage: test
64
  script:
Millian Poquet's avatar
Millian Poquet committed
65
    - cd /builds/batsim/batsim/doc
66
67
68
69
70
71
    - 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
72
      - /builds/batsim/batsim/doc/doxygen_doc/html
73

Millian Poquet's avatar
Millian Poquet committed
74
test_test:
Michael Mercier's avatar
Michael Mercier committed
75
76
  stage: test
  script:
Michael Mercier's avatar
Michael Mercier committed
77
78
79
80
81
    # Let's run the redis server
    - |
      redis-server>/dev/null &
      while ! nc -z localhost 6379; do
        sleep 1
82
      done
Michael Mercier's avatar
Michael Mercier committed
83

84
    - cd /builds/batsim/batsim/build
85
    - make install
86

87
    - cd /builds/batsim/batsim/schedulers/batsched_build
88
89
90
    - make install

    - cd /builds/batsim/batsim/build
91
    - ctest --output-on-failure -E 'remote|smpi'
92
  dependencies:
93
    - build_clang
Millian Poquet's avatar
Millian Poquet committed
94
    - build_batsched
Millian Poquet's avatar
Millian Poquet committed
95
96
97
98

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