Commit 2839ecd4 authored by George Papathanail's avatar George Papathanail
Browse files

Use explicit Python image for CI jobs

parent 09941ff7
Loading
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
default:
  cache:
    paths:
      - .cache/pip
      - .venv/

stages:
  - quality
  - test
@@ -11,32 +5,37 @@ stages:

variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  VENV_DIR: "$CI_PROJECT_DIR/.venv"

.setup_python:
cache:
  paths:
    - .cache/pip

.python_job:
  image: python:3.12-slim
  before_script:
    - python3 --version
    - python3 -m venv "$VENV_DIR"
    - . "$VENV_DIR/bin/activate"
    - python --version
    - python -m pip install --upgrade pip
    - python -m pip install -e ".[dev,postgres]"

quality:
  stage: quality
  extends: .setup_python
  extends: .python_job
  script:
    - . "$VENV_DIR/bin/activate"
    - pre-commit run --all-files

test:
  stage: test
  extends: .setup_python
  extends: .python_job
  script:
    - . "$VENV_DIR/bin/activate"
    - pytest || [ $? -eq 5 ]

build:
  stage: build
  image: docker:29.3.0
  services:
    - docker:29.3.0-dind
  variables:
    DOCKER_TLS_CERTDIR: ""
  script:
    - docker build -t oeg-ci-test .
  rules: