generated from ilkersigirci/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
72 lines (67 loc) · 1.86 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
69
70
71
72
stages:
- lint
- tests
- package
- doc
image: python:3.11
lint:
stage: lint
script: |
echo "*********** Pip Update ***********"
make -s update-pip
echo "*********** Lint Dependency Installation ***********"
make -s install-lint
echo "*********** Lint the Project ***********"
make -s lint
only:
- merge_requests
tests:
stage: tests
script: |
echo "*********** Disable Logger Outputs ***********"
sed -i "s/log_cli = true/log_cli = false/" pyproject.toml
echo "*********** Pip Update ***********"
make -s update-pip
echo "*********** Install the Project with Test Dependencies ***********"
make -s install
echo "*********** Test the Project ***********"
make -s test-parallel
only:
- merge_requests
# artifacts:
# reports:
# cobertura: coverage.xml
package:
stage: package
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created manually
script: |
echo "*********** Rename `version` with COMMIT_TAG: $CI_COMMIT_TAG ***********"
sed -i "s/0.0.0/$CI_COMMIT_TAG/" pyproject.toml
echo "*********** Pip Update ***********"
make -s update-pip
echo "*********** Build Dependency Installation ***********"
make -s install-build
echo "*********** Build the Project ***********"
make -s build
echo "*********** Publish Dependency Installation ***********"
make -s install-publish
echo "*********** Publish the Project ***********"
make -s publish
pages:
stage: doc
script: |
echo "*********** Pip Update ***********"
make -s update-pip
echo "*********** Docs Dependency Installation ***********"
make -s install-doc
echo "*********** Build the project documentation ***********"
make -s doc
# only:
# - main
rules:
- if: $CI_COMMIT_REF_NAME == "main"
when: manual
artifacts:
paths:
- public