Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.55 KiB
Newer Older
image: python:3.10-buster

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

cache:
  paths:
    - .cache/pip
Andreas Ellewsen's avatar
Andreas Ellewsen committed
    - venv/ # makes the virtual env available for jobs
Andreas Ellewsen's avatar
Andreas Ellewsen committed
stages:
  - venv update # Keep the cached virtual env up to date with dependencies
  - tests and linting # Run test/linting for frontend and backend
Andreas Ellewsen's avatar
Andreas Ellewsen committed
update:
  before_script:
    - python -V
  image: python:3.10-buster
Andreas Ellewsen's avatar
Andreas Ellewsen committed
  stage: venv update
    - make clean
Andreas Ellewsen's avatar
Andreas Ellewsen committed

backend lint:
  before_script:
    - python -V
  image: python:3.10-buster
Andreas Ellewsen's avatar
Andreas Ellewsen committed
  stage: tests and linting
  script:
Andreas Ellewsen's avatar
Andreas Ellewsen committed

backend test:
  before_script:
    - python -V
  image: python:3.10-buster
Andreas Ellewsen's avatar
Andreas Ellewsen committed
  stage: tests and linting
  script:
pka065's avatar
pka065 committed
  coverage: /^TOTAL.*\s+(\d+\%)$/
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml
backend build:
  before_script:
    - python -V
  image: python:3.10-buster
  stage: tests and linting
    - pip install poetry
Andreas Ellewsen's avatar
Andreas Ellewsen committed
frontend test:
  image: node:16-alpine
Andreas Ellewsen's avatar
Andreas Ellewsen committed
  stage: tests and linting
  script:
    - cd frontend
    - npm install -g npm@latest
    - npm ci
    - npm run coverage:ci
  coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
Andreas Ellewsen's avatar
Andreas Ellewsen committed

frontend lint:
  image: node:16-alpine
Andreas Ellewsen's avatar
Andreas Ellewsen committed
  stage: tests and linting
  script:
    - cd frontend
    - npm install -g npm@latest
    - npm ci
    - npm run lint
  image: node:16-alpine
  stage: tests and linting
  script:
    - cd frontend
    - npm install -g npm@latest
    - NODE_ENV=production
    - npm ci
    - npm run build:no-env