Skip to content
Snippets Groups Projects
.gitlab-ci.yml 7.49 KiB
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/python:3.12-slim

variables:
  FF_NETWORK_PER_BUILD: 1
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  PYTHONPATH: "$CI_PROJECT_DIR"
  CLOWM_UI_URI: "http://localhost"
  CLOWM_S3__URI: "http://localhost"
  CLOWM_S3__ACCESS_KEY: "nonempty"
  CLOWM_S3__SECRET_KEY: "nonempty"
  CLOWM_LIFESCIENCE_OIDC__CLIENT_SECRET: "nonempty"
  CLOWM_LIFESCIENCE_OIDC__CLIENT_ID: "nonempty"
  CLOWM_CLUSTER__SLURM__TOKEN: "nonempty"
  CLOWM_CLUSTER__SLURM__URI: "http://localhost"
  CLOWM_DEV_SYSTEM: true
  CLOWM_CLUSTER__JOB_MONITORING: "LINEAR"
  CLOWM_CLUSTER__ACTIVE_WORKFLOW_EXECUTION_LIMIT: 3
  CLOWM_CLUSTER__TOWER_SECRET: "nonempty"

cache:
  paths:
    - .cache/pip
    - venv/

default:
  tags:
    - docker
  before_script:
    - python --version  # For debugging
    - pip install --disable-pip-version-check virtualenv
    - virtualenv venv
    - source venv/bin/activate
    - python -m pip install --disable-pip-version-check --upgrade -r requirements.txt -r requirements-dev.txt

stages: # List of stages for jobs, and their order of execution
  - lint
  - test
  - deploy-docker-images

lint-test-job: # Runs linters checks on code
  stage: lint
  before_script:
    - python --version  # For debugging
    - pip install --disable-pip-version-check virtualenv
    - virtualenv venv
    - source venv/bin/activate
    - python -m pip install --disable-pip-version-check --upgrade -r requirements.txt -r requirements-dev.txt --upgrade-strategy=eager
  script:
    - ./scripts/lint.sh


integration-test-job: # Runs integration tests with the database
  stage: test
  variables:
    CLOWM_DB__PASSWORD: "$TEST_DB_PASSWORD"
    CLOWM_DB__USER: "test_api_user"
    CLOWM_DB__NAME: "integration-test-db"
    CLOWM_DB__HOST: "integration-test-db"
    CLOWM_S3__URI: "http://integration-test-mock-s3:8000"
  services:
    - name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/mysql:8
      alias: integration-test-db
      variables:
        MYSQL_RANDOM_ROOT_PASSWORD: "yes"
        MYSQL_DATABASE: "$CLOWM_DB__NAME"
        MYSQL_USER: "$CLOWM_DB__USER"
        MYSQL_PASSWORD: "$CLOWM_DB__PASSWORD"
    - name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/motoserver/moto:latest
      alias: integration-test-mock-s3
      variables: