-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.55 KB
/
python-check.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
name: Python-check
on:
push:
branches: [ dev, main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# we want to test our package on several versions of Python
python-version: ['3.11']
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_pass
POSTGRES_DB: test_db
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 3
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# make depends on poetry
- name: Install dependencies
run: |
pip install poetry
make install
- name: Run linter and pytest
env:
TEST_DATABASE_URL: postgresql://test_user:test_pass@localhost:5433/test_db
SECRET_KEY: supersecret
run: |
make check
- name: Test & publish code coverage
uses: paambaati/[email protected]
if: github.ref_name == 'main'
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
TEST_DATABASE_URL: postgresql://test_user:test_pass@localhost:5433/test_db
SECRET_KEY: supersecret
with:
coverageCommand: make test-coverage
debug: true