forked from ywz978020607/MASIC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
110 lines (101 loc) · 2.04 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
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
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- "$CI_PROJECT_DIR/.cache/pip"
stages:
- build
- static-analysis
- test
- doc
wheel:
image: python:$PYTHON_VERSION-buster
stage: build
before_script:
- pip install build
script:
- python -m build --wheel .
artifacts:
paths:
- dist/
expire_in: 1 day
parallel:
matrix:
- PYTHON_VERSION: ['3.6', '3.7', '3.8', '3.9']
tags:
- docker
sdist:
image: python:3.6-buster
stage: build
before_script:
- pip install build
script:
- python -m build --sdist .
tags:
- docker
flake8:
stage: static-analysis
image: pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel
before_script:
- python --version
- pip install flake8 flake8-bugbear flake8-comprehensions
script:
- flake8 compressai tests examples docs
tags:
- docker
black:
stage: static-analysis
image: python:3.6-buster
before_script:
- python --version
- pip install black
script:
- make check-black
tags:
- docker
isort:
stage: static-analysis
image: python:3.6-buster
before_script:
- python --version
- pip install .
- pip install isort
script:
- make check-isort
tags:
- docker
test:
stage: test
image: pytorch/pytorch:$PYTORCH_IMAGE
before_script:
- python --version
- pip install -e .
- pip install -r requirements.txt
- pip install click pytest pytest-cov plotly
script:
- >
if [ "$CI_COMMIT_BRANCH" == "master" ]; then
pytest --cov=compressai -s tests
else
pytest --cov=compressai -m "not pretrained" -s tests
fi
parallel:
matrix:
- PYTORCH_IMAGE:
- "1.9.0-cuda11.1-cudnn8-devel"
- "1.8.1-cuda11.1-cudnn8-devel"
- "1.7.1-cuda11.0-cudnn8-devel"
tags:
- docker
doc:
stage: doc
image: pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel
before_script:
- python --version
- pip install -e .
- cd docs
- pip install -r requirements.txt
script:
- make html
tags:
- docker