https://gitlab.math.unistra.fr/llg3d/llg3d
Tip revision: c1e36c1326fe05067fd2b75124ebd7454d9a8395 authored by Matthieu Boileau on 25 June 2024, 14:14:02 UTC
Merge branch 'develop' into 'main'
Merge branch 'develop' into 'main'
Tip revision: c1e36c1
.gitlab-ci.yml
image: python:3.11
stages:
- deps
- test&doc
- deploy
- release
deps:
stage: deps
tags:
- shell
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --pull -t $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:latest
pytest:
stage: test&doc
image: $CI_REGISTRY_IMAGE:latest
tags:
- docker
script:
- pip install -U pip
- pip install -e .[test]
- coverage run --rcfile=pyproject.toml -m pytest tests/ # Run tests in sequential
- mpirun -np 6 coverage run -m pytest -s --with-mpi tests/ # Run tests in parallel
- coverage combine
artifacts:
paths:
- .coverage
sphinx:
stage: test&doc
image: $CI_REGISTRY_IMAGE:latest
tags:
- docker
script:
- pip install -e .[doc]
- sphinx-build -b html docs/source/ public/
artifacts:
paths:
- public
pages:
stage: deploy
image: $CI_REGISTRY_IMAGE:latest
tags:
- pages
script:
- coverage report
- coverage html -d public/coverage
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- public
only:
- main
- dev-doc
release_to_gitlab:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
tags:
- docker
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: "$CI_COMMIT_TAG"
description: "$CI_COMMIT_TAG_MESSAGE"
release_to_pypi:
stage: release
tags:
- docker
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- pip install build twine
- python -m build
- TWINE_PASSWORD=${PYPI_TOKEN} TWINE_USERNAME=__token__ python -m twine upload dist/*