Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.18 KiB
Newer Older
Mélodie Boillet's avatar
Mélodie Boillet committed
stages:
  - test
  - build
  - deploy

lint:
Yoann Schneider's avatar
Yoann Schneider committed
  image: python:3.10
Mélodie Boillet's avatar
Mélodie Boillet committed
  stage: test

  cache:
    paths:
      - .cache/pre-commit

  except:
    - schedules

  variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
    PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"

  before_script:
    - pip install pre-commit

  script:
    - pre-commit run -a

Yoann Schneider's avatar
Yoann Schneider committed
test:
  image: python:3.10

  stage: test
  cache:
    paths:
      - .cache/pip

  variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
    ARKINDEX_API_SCHEMA_URL: schema.yml

  before_script:
    - pip install tox

    # Download OpenAPI schema from last backend build
    - curl https://assets.teklia.com/arkindex/openapi.yml > schema.yml

    # Add system deps for opencv
    - apt-get update -q
    - apt-get install -q -y libgl1

  except:
    - schedules

  script:
    - tox

Mélodie Boillet's avatar
Mélodie Boillet committed
bump-python-deps:
  stage: deploy
  image: registry.gitlab.com/teklia/devops:latest

  only:
    - schedules

  script:
    - devops python-deps requirements.txt
Mélodie Boillet's avatar
Mélodie Boillet committed

release-notes:
  stage: deploy
  image: registry.gitlab.com/teklia/devops:latest

  rules:
    - if: '$CI_COMMIT_TAG'
      when: on_success
    - when: never

  script:
    - devops release-notes