-
Notifications
You must be signed in to change notification settings - Fork 76
135 lines (101 loc) · 3.46 KB
/
build.yaml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build
on: push
# on:
# pull_request:
# branches: [main]
# workflow_dispatch:
# inputs:
# debug_enabled:
# type: boolean
# description: Debug with tmate
# required: false
# default: false
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install .[dev]
- name: Run black
run: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/
- name: Run flake8
run: flake8 ./arango ./tests
- name: Run isort
run: isort --check ./arango ./tests
- name: Run mypy
run: mypy ./arango
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.10"] #["3.8", "3.9", "3.10", "3.11", "3.12"]
arangodb_config: ["single"] #["single", "cluster"]
arangodb_license: ["community"] #["community", "enterprise"]
arangodb_version: ["latest"] #["3.10.10", "3.11.4", "latest"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Setup ArangoDB
run: |
chmod +x starter.sh
./starter.sh ${{ matrix.arangodb_config }} ${{ matrix.arangodb_license }} ${{ matrix.arangodb_version }}
- name: Install Dependencies
run: pip install -e .[dev]
# - name: Sleep
# run: sleep 15
- name: List Docker Containers
run: docker ps -a
# - name: Show Docker Logs
# run: docker logs arango
# - name: Curl Request
# run: curl -v http://localhost:8529/
- name: Pytest
run: |
args=("--host" "localhost" "--port=8529")
if [ ${{ matrix.arangodb_config }} = "cluster" ]; then
args+=("--cluster" "--port=8539" "--port=8549")
fi
if [ ${{ matrix.arangodb_license }} = "enterprise" ]; then
args+=("--enterprise")
fi
echo "Running pytest with args: ${args[@]}"
pytest --cov=arango --cov-report=xml "${args[@]}"
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch all tags and branches
run: git fetch --prune --unshallow
- name: Create ArangoDB Docker container
run: >
docker create --name arango -p 8529:8529 -e ARANGO_ROOT_PASSWORD=passwd -v "$(pwd)/tests/static/":/tests/static
arangodb/arangodb:latest --server.jwt-secret-keyfile=/tests/static/keyfile
- name: Start ArangoDB Docker container
run: docker start arango
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Debug with tmate
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Run pre-commit checks
uses: pre-commit/[email protected]
- name: Install dependencies
run: pip install .[dev]
- name: Run Sphinx doctest
run: python -m sphinx -b doctest docs docs/_build
- name: Generate Sphinx HTML
run: python -m sphinx -b html -W docs docs/_build