Skip to content

Commit 0ed6e2a

Browse files
committed
add different python version
1 parent f755bce commit 0ed6e2a

File tree

1 file changed

+103
-1
lines changed

1 file changed

+103
-1
lines changed

.github/workflows/ci.yml

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1515
jobs:
16-
build:
16+
ciPython37:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
@@ -28,6 +28,108 @@ jobs:
2828
ports:
2929
- 5432:5432
3030
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v1
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt
41+
- name: Enable Postgres Trigram Extension
42+
run: |
43+
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
44+
- name: Test with unittest
45+
env:
46+
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/ci_db_test
47+
TEST_DATABASE_ASYNC_URL: postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
48+
run: |
49+
python -m unittest discover -s ./tests/test_implementations
50+
ciPython38:
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
python-version: [ 3.8 ]
55+
services:
56+
postgres:
57+
image: postgres:11
58+
env:
59+
POSTGRES_USER: postgres
60+
POSTGRES_PASSWORD: postgres
61+
POSTGRES_DB: ci_db_test
62+
ports:
63+
- 5432:5432
64+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
65+
steps:
66+
- uses: actions/checkout@v3
67+
- name: Set up Python ${{ matrix.python-version }}
68+
uses: actions/setup-python@v1
69+
with:
70+
python-version: ${{ matrix.python-version }}
71+
- name: Install dependencies
72+
run: |
73+
python -m pip install --upgrade pip
74+
pip install -r requirements.txt
75+
- name: Enable Postgres Trigram Extension
76+
run: |
77+
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
78+
- name: Test with unittest
79+
env:
80+
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/ci_db_test
81+
TEST_DATABASE_ASYNC_URL: postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
82+
run: |
83+
python -m unittest discover -s ./tests/test_implementations
84+
ciPython39:
85+
runs-on: ubuntu-latest
86+
strategy:
87+
matrix:
88+
python-version: [ 3.9 ]
89+
services:
90+
postgres:
91+
image: postgres:11
92+
env:
93+
POSTGRES_USER: postgres
94+
POSTGRES_PASSWORD: postgres
95+
POSTGRES_DB: ci_db_test
96+
ports:
97+
- 5432:5432
98+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
99+
steps:
100+
- uses: actions/checkout@v3
101+
- name: Set up Python ${{ matrix.python-version }}
102+
uses: actions/setup-python@v1
103+
with:
104+
python-version: ${{ matrix.python-version }}
105+
- name: Install dependencies
106+
run: |
107+
python -m pip install --upgrade pip
108+
pip install -r requirements.txt
109+
- name: Enable Postgres Trigram Extension
110+
run: |
111+
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
112+
- name: Test with unittest
113+
env:
114+
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/ci_db_test
115+
TEST_DATABASE_ASYNC_URL: postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
116+
run: |
117+
python -m unittest discover -s ./tests/test_implementations
118+
ciPython310:
119+
runs-on: ubuntu-latest
120+
strategy:
121+
matrix:
122+
python-version: [ 3.10 ]
123+
services:
124+
postgres:
125+
image: postgres:11
126+
env:
127+
POSTGRES_USER: postgres
128+
POSTGRES_PASSWORD: postgres
129+
POSTGRES_DB: ci_db_test
130+
ports:
131+
- 5432:5432
132+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
31133
steps:
32134
- uses: actions/checkout@v3
33135
- name: Set up Python ${{ matrix.python-version }}

0 commit comments

Comments
 (0)