Newer
Older
- mkdir -p micromamba
- export MAMBA_ROOT_PREFIX=micromamba
- micromamba create -yf docs/environment.yml
- eval "$(micromamba shell hook --shell bash)"
run tests:
script:
- pip install pytest-cov pytest-randomly pytest-repeat pytest-ruff pytest-regressions
- py.test
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- htmlcov
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
cache:
key: "$CI_JOB_NAME"
paths:
- micromamba
run nox:
variables:
GIT_STRATEGY: clone
CONDA_PKGS_DIRS: micromamba/pkgs
parallel:
matrix:
- NOXSESSION:
- "tests(minimal)"
- "tests(mid)"
- "tests(latest)"
script:
- micromamba install -c conda-forge -y nox mamba
- nox -s $NOXSESSION
cache:
key: "$CI_JOB_NAME"
paths:
- micromamba
run profiler:
script:
- pip install memray pyinstrument
- python profiling/graphene.py
- memray stats memoryProfile.bin
- memray summary memoryProfile.bin
variables:
OPENBLAS_NUM_THREADS : 1
OMP_NUM_THREADS : 1
MKL_DYNAMIC : FALSE
MKL_NUM_THREADS : 1
script:
- make -C docs/ html SPHINXOPTS="-WT --keep-going -n"
artifacts:
paths:
- docs/build
pages:
needs:
- run tests
- run profiler
- run docs
script:
- mkdir public
- cp -r htmlcov public/
- cp -r docs/build public/
- cp -r timeProfile.html public/
artifacts:
paths:
- public
run pre-commit:
variables:
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.pre-commit-cache
script:
- micromamba install -c conda-forge -y mamba pip pre-commit git
- git config --global --add safe.directory $CI_PROJECT_DIR
- pre-commit run --all-files
cache:
key: "$CI_JOB_NAME"
paths:
- .pre-commit-cache
- micromamba
prepare zips:
image: gitlab.kwant-project.org:5005/qt/research-docker
before_script: []
when: manual
script:
- zip -r zenodo.zip *
artifacts:
paths:
- zenodo.zip
publish to test pypi:
needs:
- run tests
- run docs
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*\+test$/' # vX.Y.Z.post1+test
script:
- micromamba install -c conda-forge -y hatch hatch-vcs
- hatch build
- hatch publish -u __token__ -a $PYPI_TEST_TOKEN -r test
publish to pypi:
needs:
- run tests
- run docs
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+[^+]*$/' # No +test
script:
- micromamba install -c conda-forge -y hatch hatch-vcs
- hatch build
- hatch publish -u __token__ -a $PYPI_TOKEN