-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (85 loc) · 2.94 KB
/
Copy pathci.yml
File metadata and controls
90 lines (85 loc) · 2.94 KB
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
name: CI
on:
pull_request:
push:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.12", "3.14"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: python -m pip install -e '.[dev]'
- run: ruff check .
- run: ruff format --check .
- run: mypy
- run: pytest
- if: matrix.python-version == '3.12'
run: python -m build
- if: matrix.python-version == '3.12'
run: twine check dist/*
generated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.12"
cache: pip
- run: python -m pip install -e '.[dev]'
- run: ./scripts/generate.sh
- run: git diff --exit-code
integration:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
ORBITA_ENDPOINT: http://127.0.0.1:7100
ORBITA_ROOT_CREDENTIAL: orbita-python-ci-root
ORBITA_IMAGE: ghcr.io/orbita-rocks/orbita@sha256:a4b34c2a2ae0bfa7a22915f672fab6eb19413b0cd49424565646db254a1f4279
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.12"
cache: pip
- run: python -m pip install -e '.[dev]'
- name: Pull pinned image
run: docker pull "$ORBITA_IMAGE"
- name: Start Orbita
run: |
docker run --detach \
--name orbita-python-integration \
--publish 127.0.0.1:7100:7100 \
--env ORBITA_REQUIRE_AUTH=true \
--env ORBITA_ROOT_CREDENTIAL="$ORBITA_ROOT_CREDENTIAL" \
"$ORBITA_IMAGE" \
dev --port 7100 --data-dir /var/lib/orbita/dev --keyspace bootstrap
- name: Wait for readiness
run: |
for _ in $(seq 1 60); do
if docker exec orbita-python-integration /usr/local/bin/orbita \
--endpoint http://127.0.0.1:7100 cluster ready; then
exit 0
fi
if [ "$(docker inspect --format '{{.State.Running}}' orbita-python-integration)" != true ]; then
docker logs orbita-python-integration
exit 1
fi
sleep 1
done
exit 1
- run: pytest -m integration -o addopts='-q -ra'
- name: Orbita logs
if: failure()
run: docker logs orbita-python-integration
- name: Clean up
if: always()
run: docker rm --force orbita-python-integration >/dev/null 2>&1 || true