-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
68 lines (58 loc) · 1.5 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
image: python:3.10
stages:
- testing
- qa
- publish
- docs
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_TAG != null || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)'
variables:
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
cache:
key: "${CI_JOB_NAME}"
paths:
- .cache/pip
.testing-unit:
stage: testing
before_script:
- pip install --upgrade pip
- pip install jax[cpu]
- pip install .[dev]
script:
- pytest -m "not slow"
rules:
- if: '$CI_COMMIT_TAG == null'
testing-unit/3.10:
extends: .testing-unit
image: python:3.10
coverage: '/^TOTAL.+?(\d+\%)$/'
testing-unit/3.11:
extends: .testing-unit
image: python:3.11
testing-unit/3.12:
extends: .testing-unit
image: python:3.12
pre-commits:
stage: qa
needs: []
before_script:
- pip install pre-commit
- pre-commit install
script:
- pre-commit run --all-files
rules:
- if: '$CI_COMMIT_TAG == null'
publish-release-package:
stage: publish
interruptible: true
before_script:
- pip install twine build setuptools_scm
script:
- python -m build
- TWINE_PASSWORD=$CI_JOB_TOKEN TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*.tar.gz dist/*.whl
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+/'