-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
97 lines (84 loc) · 2.3 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
default:
image: python:3.8
tags:
- ec2-docker
stages:
- test
- deploy
cache:
key: "${CI_COMMIT_REF_SLUG}"
paths:
- .cache/pip
- .venv
.install-dependencies:
&install-dependencies # Recommended install method for Poetry: https://python-poetry.org/docs/
- curl -sSL https://install.python-poetry.org | python3 - --version 1.6.1
- export PATH="~/.local/bin:$PATH"
- poetry --version
- poetry config virtualenvs.in-project true
- poetry run python -m ensurepip --upgrade
- poetry install -vv
.install-npm: &install-npm
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- apt-get update
- apt-get install -f -y nodejs npm
- npm i
Checks:
stage: test
script:
- *install-dependencies
- poetry run make check-all
.unit-test:
variables:
QCS_SETTINGS_APPLICATIONS_QVM_URL: "http://qvm:5000"
QCS_SETTINGS_APPLICATIONS_QUILC_URL: "tcp://quilc:5555"
services:
- name: rigetti/qvm
alias: qvm
command: [ "-S" ]
- name: rigetti/quilc
alias: quilc
entrypoint: [ "bash", "-c", "curl -L -o qelib1.inc https://raw.githubusercontent.com/Qiskit/qiskit-terra/0.16.2/qiskit/qasm/libs/qelib1.inc && ./quilc -S -P" ]
coverage: '/TOTAL.*?(\d+)\%/'
script:
- *install-dependencies
- poetry run make test
stage: test
Test Unit (3.8):
extends: .unit-test
image: python:3.8
Test Unit (3.9):
extends: .unit-test
image: python:3.9
Test Unit (3.10):
extends: .unit-test
image: python:3.10
.pypi-publish:
stage: deploy
before_script:
- . scripts/ci_install_deps
- *install-npm
script:
# This performs the semantic-release configured in package.json.
# Depending on the config, this may add a tag and then publish a GitLab/GitHub release.
- npx semantic-release --debug
- poetry version -s >> version_tag
# This reads the tag chosen by semantic-release
- poetry config http-basic.pypi $PUBLIC_PYPI_USERNAME $PUBLIC_PYPI_PASSWORD
- poetry publish --build
artifacts:
paths:
- version_tag
when: always
# PUBLISH RC
# -------------------------------
PyPI Publish (RC):
extends: .pypi-publish
rules:
- if: '$CI_COMMIT_BRANCH == "rc"'
when: manual
PyPI Publish (Final):
extends: .pypi-publish
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
when: manual