.gitlab-ci.yml 5.34 KB
Newer Older
spmohanty's avatar
spmohanty committed
1
image: themattrix/tox
spmohanty's avatar
spmohanty committed
2

3
4
5
6
7
8
9
10
11
12
##########################################
##########################################
## We have to set the following env vars
## in the admin interface :
## - AWS_DEFAULT_REGION
## - BUCKET_NAME
## - AWS_ACCESS_KEY_ID
## - AWS_SECRET_ACCESS_KEY

stages:
13
    - build_wheel
14
    - tests
15
    - integration_testing
16
17
    - profiling
    - benchmarks
18
    - deploy_docs
spmohanty's avatar
spmohanty committed
19
20

before_script:
spmohanty's avatar
spmohanty committed
21
    - echo "Setting Up...."
spmohanty's avatar
spmohanty committed
22

23
.test-setup: &test-setup
spmohanty's avatar
spmohanty committed
24
    stage: tests
25
26
    services:
        - redis
27
    before_script:
spmohanty's avatar
spmohanty committed
28
        - apt update
hagrid67's avatar
hagrid67 committed
29
        - apt install -y libgl1-mesa-glx xvfb graphviz libgraphviz-dev xdg-utils libcairo2-dev libjpeg-dev libgif-dev python-pyglet
30
31
        - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh
        - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3
32
        - export PATH=/tmp/miniconda3/bin:$PATH
33
        - pip install tox awscli
34
        - conda update -n root conda -y
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
        - conda install -c conda-forge tox-conda -y

test-py36:
    <<: *test-setup
    script:
        - xvfb-run tox -v --recreate -e py36

test-py37:
    <<: *test-setup
    script:
        - xvfb-run tox -v --recreate -e py37

test-examples:
    <<: *test-setup
    script:
        - xvfb-run tox -v --recreate -e examples

test-notebooks:
    <<: *test-setup
    script:
        - xvfb-run tox -v --recreate -e notebooks

test-docs:
    <<: *test-setup
    script:
        - xvfb-run tox -v --recreate -e docs

test-coverage:
    <<: *test-setup
64
    script:
65
        - xvfb-run tox -v --recreate -e coverage
66
67
68
69
70
71
72

build_and_deploy_docs:
    image: "python:latest"
    stage: deploy_docs
    only:
        - master
    dependencies:
73
        - test-docs
74
    before_script:
75
        - apt update
76
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
77
78
        - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh
        - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3
79
        - export PATH=/tmp/miniconda3/bin:$PATH
80
        - pip install tox awscli
81
        - conda update -n root conda -y
82
        - conda install -c conda-forge tox-conda
u214892's avatar
u214892 committed
83
    script:
u214892's avatar
u214892 committed
84
85
86
        - echo "Bucket=${BUCKET_NAME}"
        - echo "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}"
        - echo "CI_COMMIT_REF_SLUG=${CI_COMMIT_REF_SLUG}"
u214892's avatar
u214892 committed
87
        - xvfb-run tox -v -e docs --recreate
spmohanty's avatar
spmohanty committed
88
        - aws s3 cp ./docs/_build/html/ s3://${BUCKET_NAME} --recursive
89
90
91
    environment:
        name: ${CI_COMMIT_REF_SLUG}
        url: http://${BUCKET_NAME}.s3-website.${AWS_DEFAULT_REGION}.amazonaws.com/
92

93
profiling:
94
    dependencies:
95
96
97
98
99
        - test-py36
        - test-py37
        - test-examples
        - test-notebooks
        - test-coverage
100
    stage: profiling
101
    only:
102
        variables:
103
            - $BENCHMARKS_AND_PROFILING
104
    before_script:
105
        - apt update
106
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
107
108
        - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh
        - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3
109
        - export PATH=/tmp/miniconda3/bin:$PATH
110
        - pip install tox awscli
111
        - conda update -n root conda -y
112
113
        - conda install -c conda-forge tox-conda
    script:
114
115
116
117
        - xvfb-run tox -e profiling -v --recreate

benchmarks:
    dependencies:
118
119
120
121
122
        - test-py36
        - test-py37
        - test-examples
        - test-notebooks
        - test-coverage
123
124
125
126
127
128
    stage: benchmarks
    only:
        variables:
            - $BENCHMARKS_AND_PROFILING
    before_script:
        - apt update
129
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
130
131
132
133
134
135
136
137
        - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh
        - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3
        - export PATH=/tmp/miniconda3/bin:$PATH
        - pip install tox awscli
        - conda update -n root conda -y
        - conda install -c conda-forge tox-conda
    script:
        - xvfb-run tox -e benchmarks -v --recreate
138

139
140
test_conda_setup:
    stage: integration_testing
141
142
    services:
        - redis
143
144
    before_script:
        - apt update
145
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
146
147
        - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh
        - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3
148
        - export PATH=/tmp/miniconda3/bin:$PATH
149
        - conda update -n root conda -y
150
    script:
151
        - xvfb-run bash getting_started/getting_started.sh
152

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
build_wheel:
    image: "python:3.7-slim"
    stage: build_wheel
    before_script:
        - apt update
        - apt install -y make
        - pip install -r requirements_dev.txt
    script:
        - make dist
        - export WHEEL_NAME="$( find dist -name 'flatland_rl*.whl' )"
        - mv "${WHEEL_NAME}" "${WHEEL_NAME/-py2.py3-/-py3-}"
    artifacts:
        paths:
            - dist/flatland_rl*.whl
        expire_in: 2 mos