-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (87 loc) · 2.36 KB
/
unit-test.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
name: Run Unit Tests
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
types:
- ready_for_review
- opened
- reopened
- synchronize
workflow_dispatch:
jobs:
integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
services:
# Postgres service container
postgres:
image: sibedge/postgres-plv8
env:
# Specify the password for Postgres superuser.
POSTGRES_PASSWORD: a!b@c$d()e*_,/:;=?@ff[]22
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
# Zookeeper service container (required by Kafka)
zookeeper:
image: bitnami/zookeeper
ports:
- 2181:2181
env:
ALLOW_ANONYMOUS_LOGIN: yes
options: >-
--health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181"
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Kafka service container
kafka:
image: bitnami/kafka
ports:
- 9092:9092
options: >-
--health-cmd "kafka-broker-api-versions.sh --version"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install Dependencies
run: pdm install
working-directory: ./
- name: Check Types
run: pdm run mypy .
working-directory: ./
- name: Run Unit Tests
run: pdm run pytest
working-directory: ./
env:
PGPASSWORD: a!b@c$d()e*_,/:;=?@ff[]22