Repository navigation
75 lines (72 loc) · 2.76 KB
/
Copy pathci.yml
File metadata and controls
75 lines (72 loc) · 2.76 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_DB: pyro_test
POSTGRES_USER: pyro
POSTGRES_PASSWORD: pyro-ci-password
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U pyro -d pyro_test"
--health-interval 5s
--health-timeout 3s
--health-retries 20
env:
TEST_DATABASE_URL: postgresql://pyro:pyro-ci-password@127.0.0.1:5432/pyro_test
CLOUD_TEST_DATABASE_URL: postgresql://pyro:pyro-ci-password@127.0.0.1:5432/postgres
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v7
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm audit --audit-level=high
- run: pnpm run check
- name: Local evaluation regression budget
run: pnpm evaluate --min-accuracy 1 --max-false-positive-rate 0
- name: Install CLI from its packed release outside the repository
run: pnpm --filter @delvisor/pyro run test:install
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- run: PYTHONPATH=sdks/python/src python -m unittest discover -s sdks/python/tests -v
- name: Rust SDK
run: cargo test --locked --manifest-path sdks/rust/Cargo.toml
- name: Validate containers and start with a fresh database
env:
ADMIN_PASSWORD: ci-admin-password-not-for-production
CONTROL_PLANE_SECRET: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
POSTGRES_PASSWORD: 0123456789abcdef0123456789abcdef
GATEWAY_API_KEY: pf_0123456789abcdef0123456789abcdef0123456789abcdef
run: |
docker compose config --quiet
cleanup() {
compose_exit_status=$?
if [ "$compose_exit_status" -ne 0 ]; then
docker compose logs --no-color || true
fi
docker compose down --volumes || compose_exit_status=$?
exit "$compose_exit_status"
}
trap cleanup EXIT
docker compose up --build --wait --wait-timeout 120
curl --fail --silent --show-error http://127.0.0.1:8080/v1/health > /dev/null
curl --fail --silent --show-error http://127.0.0.1:8081/health > /dev/null
curl --fail --silent --show-error --retry 10 --retry-connrefused --retry-delay 1 http://127.0.0.1:3000/ > /dev/null
for container in $(docker compose ps -q); do
test "$(docker inspect --format '{{.RestartCount}}' "$container")" -eq 0
done