stages:
  - build
  - ci
  - coverage
build:
  stage: build
  script:
    - python3 ./mc_frontend/update_version.py
    - docker-compose build
ci_frontend:
  stage: ci
  script:
    - docker-compose run --rm --entrypoint="npm run test-ci" mc_frontend > ci_frontend.log
  artifacts:
    paths:
      - ci_frontend.log
    when: always
ci_backend:
  stage: ci
  script:
    - docker-compose run --rm --entrypoint="./coverage_backend.sh" mcserver > ci_backend.log
  artifacts:
    paths:
      - ci_backend.log
    when: always
coverage:
  stage: coverage
  script:
    - ./coverage_ci.sh
    - cat coverage.log
  artifacts:
    paths:
      - coverage.log
    when: always
  coverage: '/Statements.*?(\d+(?:\.\d+)?)%/'