This repository was archived by the owner on Sep 21, 2023. It is now read-only.
forked from arangodb/python-arango
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig.yml
111 lines (90 loc) · 2.93 KB
/
config.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
111
version: 2.1
orbs:
codecov: codecov/codecov@3.3.0
workflows:
ci:
jobs:
- lint
- test:
name: Python (<< matrix.python_version >>) - ArangoDB (<< matrix.arangodb_license >>, << matrix.arangodb_version >> << matrix.arangodb_config >>)
matrix:
parameters:
python_version: ["3.9", "3.10", "3.11", "3.12"]
arangodb_config: ["single", "cluster"]
arangodb_license: ["community", "enterprise"]
arangodb_version: ["3.11", "latest"]
jobs:
lint:
docker:
- image: python:latest
steps:
- checkout
- run:
name: Install Dependencies
command: pip install .[dev]
- run:
name: Run black
command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/
- run:
name: Run flake8
command: flake8 ./arango ./tests
- run:
name: Run isort
command: isort --check ./arango ./tests
- run:
name: Run mypy
command: mypy ./arango
test:
parameters:
python_version:
type: string
arangodb_config:
type: string
arangodb_license:
type: string
arangodb_version:
type: string
# TODO: Reconsider using a docker image instead of a machine
# i.e cimg/python:<< parameters.python_version >>
machine:
image: ubuntu-2204:current
steps:
- checkout
- run:
name: Set Up ArangoDB
command: |
chmod +x starter.sh
./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >>
- restore_cache:
key: pip-and-local-cache
# TODO: Revisit this bottleneck
- run:
name: Setup Python
command: |
pyenv --version
pyenv install -f << parameters.python_version >>
pyenv global << parameters.python_version >>
- run:
name: "Install Dependencies"
command: pip install -e .[dev]
- run: docker ps -a
- run: docker logs arango
- run:
name: "Run pytest"
command: |
mkdir test-results
args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529")
if [ << parameters.arangodb_config >> = "cluster" ]; then
args+=("--cluster" "--port=8539" "--port=8549")
fi
if [ << parameters.arangodb_license >> = "enterprise" ]; then
args+=("--enterprise")
fi
echo "Running pytest with args: ${args[@]}"
pytest --cov=arango --cov-report=xml --cov-report term-missing --color=yes --code-highlight=yes "${args[@]}"
- store_artifacts:
path: test-results
- store_test_results:
path: test-results
- codecov/upload:
file: coverage.xml