-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
85 lines (70 loc) · 2.25 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
# This code is part of Tergite
#
# (C) Copyright Chalmers Next Labs 2024
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
stages:
- tests
- application_run
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PYTHON_VERSION: "3.10"
REDIS_PORT: 6378
tests:
stage: tests
image: python:${PYTHON_VERSION}
script:
# Install redis
- apt-get update
- apt-get install redis ffmpeg libsm6 libxext6 -y
# Run the redis server
- redis-server --daemonize yes --port "$REDIS_PORT"
# Install project dependencies
- pip install .
- pip install pytest black==24.10.0 requests-mock==1.11.0 pylint
# Check formatting
- black --check tergite_autocalibration
# Run unit tests
- pytest tergite_autocalibration
- pylint tergite_autocalibration --fail-under=6.0
cache:
paths:
- .cache/pip
application_run:
stage: application_run
image: python:${PYTHON_VERSION}
script:
# Install redis
- apt-get update
- apt-get install redis ffmpeg libsm6 libxext6 -y
# Run the redis server
- redis-server --daemonize yes --port "$REDIS_PORT"
# Install project dependencies
- pip install --upgrade pip
- pip install .
# Create empty .env file to make the system believe there is a file
- touch .env
# Load configuration
- acli config load -t fc8a
# Reset redis
- echo "y" | acli node reset -a
# Run the calibration chain in reanalyse mode to T2_echo
- acli calibration start -r "$CI_PROJECT_DIR/datasets/fc8_unit_tests_6-15" -n rabi_oscillations
# Verify output
- |
OUTPUT_FILE="$CI_PROJECT_DIR/datasets/fc8_unit_tests_6-15/rabi_oscillations.png"
if [ -f "$OUTPUT_FILE" ]; then
echo "Output file $OUTPUT_FILE exists. Application ran successfully."
else
echo "Error: Output file $OUTPUT_FILE not found."
exit 1
fi
cache:
paths:
- .cache/pip