generated from SpaceShaman/pypi-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.36 KB
/
coverage.yml
File metadata and controls
46 lines (44 loc) · 1.36 KB
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
name: Coverage
on:
release:
types: [published]
jobs:
coverage:
runs-on: ubuntu-22.04
# Service containers to run tests that require connections to postgres
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: poetry install --all-extras
- name: Run tests and collect coverage
run: poetry run pytest --cov=sqlift --cov-report=xml
- name: Upload coverage raports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}