Skip to content
Snippets Groups Projects
.gitlab-ci.yml 4.72 KiB
stages:
 - install
 - test
 - deploy_pages
 - update_codemeta
 - test_codemeta
 - build_containers
 - zenodo
 - pypi_publish

include: '.gitlab-ci-update-codemeta.yml'

.junit_template: &junit_definition
    artifacts:
      reports:
        junit: "junit*.xml"


install:
  stage: install
  image: python:slim
  script:
    - apt-get -y update && apt-get install git -y
    - pip install --upgrade pip
    - pip install .
    - eossr-codemeta2zenodo --help
    - eossr-codemeta2zenodo --input_codemeta_file ./codemeta.json
    - cat .zenodo.json
  only:
    - branches


test:
  stage: test
  image: python:3.9-slim
  script:
    - apt-get -y update && apt-get install git gcc -y
    - pip install --upgrade setuptools pip wheel
    - pip install -e ".[tests]"
    - pytest eossr/
      --junitxml=junit_py37.xml
      --color=yes
      --verbose
      --cov=eossr
      --cov-report=xml
      --cov-report=term
      --capture=no
    - apt update --yes && apt install --yes pandoc
    - pip install -U -r docs/doc_requirements.txt
    - sphinx-build docs _public
  artifacts:
    when: always
    paths:
      - junit_py37.xml
    reports:
      junit: junit_py37.xml


test_ci_eossr:
  stage: test
  trigger: escape2020/wp3/test_eossr


# Intended to be run when a user modifies codemeta.json but rules cause detached pipelines that cause other issues
# Commenting for now, codemeta is tested after being modified by CI in master (see gitlab-ci-update-codemeta.yml)
#test_codemeta_ingestion:
#  stage: test_codemeta
#  image: gitlab-registry.in2p3.fr/escape2020/wp3/eossr:dev
#  script:
#    - eossr-check-connection-zenodo --token $ZENODO_TOKEN -p $CI_PROJECT_DIR