Skip to content
Snippets Groups Projects
.gitlab-ci.yml 5.32 KiB
Newer Older
image: themattrix/tox
spmohanty's avatar
spmohanty committed

##########################################
##########################################
## 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:
    - integration_testing
spmohanty's avatar
spmohanty committed

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

.test-setup: &test-setup
spmohanty's avatar
spmohanty committed
    stage: tests
        - apt update
        - apt install -y libgl1-mesa-glx xvfb graphviz libgraphviz-dev xdg-utils libcairo2-dev libjpeg-dev libgif-dev python-pyglet
        - 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 -y

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

adrian_egli2's avatar
adrian_egli2 committed
test-py38:
    <<: *test-setup
    script:
        - xvfb-run tox -v --recreate -e py38

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

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

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

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

build_and_deploy_docs:
    image: "python:latest"
    stage: deploy_docs
    only:
        - master
    dependencies:
        - test-docs
    before_script:
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
        - 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
u214892's avatar
u214892 committed
    script:
        - 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
        - xvfb-run tox -v -e docs --recreate
        - aws s3 cp ./docs/_build/html/ s3://${BUCKET_NAME} --recursive
    environment:
        name: ${CI_COMMIT_REF_SLUG}
        url: http://${BUCKET_NAME}.s3-website.${AWS_DEFAULT_REGION}.amazonaws.com/
adrian_egli2's avatar
adrian_egli2 committed
        - test-py39
        - test-py38
        - test-py37
        - test-examples
        - test-coverage
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
        - 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 profiling -v --recreate

benchmarks:
    dependencies:
adrian_egli2's avatar
adrian_egli2 committed
        - test-py39
        - test-py38
        - test-py37
        - test-examples
        - test-coverage
    stage: benchmarks
    only:
        variables:
            - $BENCHMARKS_AND_PROFILING
    before_script:
        - apt update
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
        - 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
test_conda_setup:
    stage: integration_testing
    before_script:
        - apt update
        - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev graphviz libgraphviz-dev python-pyglet
        - 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
        - conda update -n root conda -y
        - xvfb-run bash getting_started/getting_started.sh
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