Skip to content

Commit 645e20b

Browse files
committed
Add e2e tests to CI
1 parent 2696508 commit 645e20b

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Lint and test source code
2+
3+
on:
4+
push:
5+
branches: [ $default-branch ]
6+
pull_request:
7+
8+
jobs:
9+
10+
integration-tests:
11+
runs-on: ubuntu-latest
12+
# From https://docs.github.com/en/actions/tutorials/use-containerized-services/create-postgresql-service-containers#configuring-the-runner-job-for-jobs-directly-on-the-runner-machine
13+
services:
14+
# Label used to access the service container
15+
postgres:
16+
# Docker Hub image
17+
image: postgres
18+
# Provide the password for postgres
19+
env:
20+
POSTGRES_PASSWORD: postgres
21+
# Set health checks to wait until postgres has started
22+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
27+
ports:
28+
# Maps tcp port 5432 on service container to the host
29+
- 5432:5432
30+
strategy:
31+
matrix:
32+
python-version: ["3.12",]
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0 # Needed for versioningit to find the repo version
37+
- uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Install dependencies
42+
run: python -m pip install .[drf]
43+
44+
- name: Install dependencies
45+
run: python -m pip install --upgrade pip
46+
-r requirements/requirements-dev.in
47+
-r requirements/requirements-test.in
48+
49+
- name: Run unit tests
50+
run: python3 run_e2e_tests.py
51+
env:
52+
# The hostname used to communicate with the PostgreSQL service container
53+
POSTGRES_HOST: localhost
54+
# The default PostgreSQL port
55+
POSTGRES_PORT: 5432

0 commit comments

Comments
 (0)