-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
83 lines (74 loc) · 1.99 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
stages:
- test
- documentation
default:
image: python:3.10
before_script:
- python --version
- pip --version
- echo "$TRANSPILER_PATH"
tests:
stage: test
script:
- cd ./$TRANSPILER_PATH
- pip install --upgrade pip
- pip install .[all]
- pip list
- python tests/run_tests.py
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_REF_NAME == "develop"
test_old_qiskit_version:
stage: test
script:
- cd ./$TRANSPILER_PATH
- pip install --upgrade pip
- pip install .[all]
- pip install qiskit==1.0.2
- pip install qiskit-aer==0.13.3
- pip install qiskit-ibm-runtime==0.22.0
- pip install pytket==1.31.0
- pip install pytket-qiskit==0.51.0
- pip list
- python tests/run_tests.py
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_REF_NAME == "develop"
linting:
stage: test
script:
- pip install flake8
- flake8 $TRANSPILER_PATH
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_REF_NAME == "develop"
pages:
stage: documentation
script:
- echo "Deploying GitLab documentation"
- pip install pdoc3
- pip install ./$TRANSPILER_PATH/.
- pdoc --html ./$TRANSPILER_PATH/rivet_transpiler --output-dir public_gitlab
- mv public_gitlab/rivet_transpiler/* public_gitlab/
- echo "Deployed GitLab documentation to $CI_PAGES_URL"
artifacts:
paths:
- public_gitlab
# expire_in: 20 minutes
publish: public_gitlab
rules:
- if: $CI_COMMIT_REF_NAME == "develop"
github_documentation:
stage: documentation
script:
- echo "Deploying GitHub documentation"
- apt update
- apt -y install gcc python3-dev pandoc python3-psutil
- pip3 install ./$TRANSPILER_PATH/.
- pip3 install -r ./$TRANSPILER_PATH/docs/requirements.txt
- python3 -m sphinx -b html ./$TRANSPILER_PATH/docs/source public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH