-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (60 loc) · 1.98 KB
/
examples.yml
File metadata and controls
74 lines (60 loc) · 1.98 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
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
name: Examples Tests
on:
push:
branches: [main, develop]
paths:
- 'examples/**'
- 'examples_tests/**'
- 'pgmq_sqlalchemy/**'
- '.github/workflows/examples.yml'
pull_request:
branches: [main, develop]
paths:
- 'examples/**'
- 'examples_tests/**'
- 'pgmq_sqlalchemy/**'
- '.github/workflows/examples.yml'
jobs:
test-examples:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
name: Test Examples (Python ${{ matrix.python-version }})
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv sync --all-groups --no-group docs
- name: Start PostgreSQL
run: |
cp pgmq_postgres.template.env pgmq_postgres.env
cp pgmq_tests.template.env pgmq_tests.env
make start-db
- name: Setup database for examples tests
run: |
docker compose exec -T pgmq_postgres psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS pgmq CASCADE;"
- name: Run examples tests
run: |
uv run pytest examples_tests --cov=examples --cov-report=xml:coverage-examples-py${{ matrix.python-version }}.xml -vss
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-examples-py${{ matrix.python-version }}
path: coverage-examples-py${{ matrix.python-version }}.xml
retention-days: 1
- name: Cleanup
if: always()
run: |
docker compose down