-
Notifications
You must be signed in to change notification settings - Fork 13
71 lines (62 loc) · 1.87 KB
/
test-suite.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
name: Test Suite
on:
push:
paths-ignore:
- 'docs/**'
branches:
- main
pull_request:
branches:
- '**'
jobs:
tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [Ubuntu]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
services:
postgres:
image: docker.io/postgres:9.6-alpine
env:
POSTGRES_PASSWORD: hasura
POSTGRES_USER: hasura
POSTGRES_DB: hasura
ports:
- 5432:5432
hasura:
image: quay.io/twyla-ai/hasura-world-db:latest
env:
HASURA_GRAPHQL_DATABASE_URL: postgres://hasura:hasura@postgres:5432/hasura
HASURA_GRAPHQL_ADMIN_SECRET: secret
ports:
- 8080:8080
options: --restart on-failure
steps:
- uses: actions/checkout@v4
- name: Start test container (apollo-server-v2)
shell: bash
run: docker-compose up -d apollo-server-v2
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Setup test environment
shell: bash
run: poetry install
- name: Wait for hasura
shell: bash
run: |
timeout 300s bash -c \
'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:${{ job.services.hasura.ports[8080] }}/healthz)" != "200" ]]; do sleep 5; done' \
|| false
- name: Execute test suite
shell: bash
run: |
poetry run pytest \
--server-world-db="http://127.0.0.1:${{ job.services.hasura.ports[8080] }}/v1/graphql" \
--server-apollo-v2="http://127.0.0.1:4000/graphql"