-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
112 lines (103 loc) · 2.44 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
112 lines (103 loc) · 2.44 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
stages:
- test
- build
- deploy
image: python:3.11-slim
version_check:
stage: test
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_BRANCH == "main"
script:
- pip install --upgrade pip
- pip install .
- ./utils/version_check.sh $CI_COMMIT_TAG
styling_check:
stage: test
rules:
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_COMMIT_TAG
before_script:
- pip install --upgrade pip
- pip install ruff
script:
- ruff check
- ruff format --check
pytest:
stage: test
before_script:
- pip install --upgrade pip
- pip install pytest
- pip install --no-cache-dir .
script:
- pytest tests/test_inputs.py
rules:
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_COMMIT_TAG
build_dist:
stage: build
before_script:
- pip install --upgrade pip
- pip install --upgrade build
script:
- pip install .
- python -m build .
artifacts:
paths:
- dist/*whl
- dist/*tar.gz
expire_in: 1 week
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_BRANCH == "main"
git-release:
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_BRANCH == "main"
script:
- echo "Running release job for tag $CI_COMMIT_TAG..."
release:
name: "Release $CI_COMMIT_TAG"
description: "Release $CI_COMMIT_TAG created using the release-cli provided by gitlab."
tag_name: "$CI_COMMIT_TAG"
ref: "$CI_COMMIT_SHA"
needs:
- job: build_dist
artifacts: true
- job: version_check
pypi-release:
stage: deploy
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_BRANCH == "main"
before_script:
- pip install --upgrade pip
- pip install twine
script:
- TWINE_PASSWORD="$PYPI_API_TOKEN" TWINE_USERNAME="__token__" twine upload dist/*
needs:
- job: build_dist
artifacts: true
- job: version_check
pages:
stage: deploy
variables:
GIT_STATEGY: clone
before_script:
- apt-get update
- apt-get install -y build-essential
- pip install --upgrade pip
- pip install sphinx sphinx-toolbox numpydoc piccolo-theme
- pip install anybadge
script:
- cd docs/
- make html
- cd ../
- mv docs/build/html public
after_script:
- anybadge -l docs -v sphinx -f docs_badge.svg -c green
artifacts:
paths:
- public
- docs_badge.svg
expire_in: 1 days
rules:
- if: $CI_COMMIT_BRANCH == "main"