File: ci.yml

package info (click to toggle)
pgcli 4.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,472 kB
  • sloc: python: 9,739; sh: 67; makefile: 8
file content (92 lines) | stat: -rw-r--r-- 2,420 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: pgcli

on:
  push:
    branches:
      - main
  pull_request:
    paths-ignore:
      - '**.rst'

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

    services:
      postgres:
        image: postgres:10
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        ports:
            - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04 # v6.0.0
        with:
          version: "latest"

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install pgbouncer
        run: |
            sudo apt install pgbouncer -y

            sudo chmod 666 /etc/pgbouncer/*.*

            cat <<EOF > /etc/pgbouncer/userlist.txt
            "postgres" "postgres"
            EOF

            cat <<EOF > /etc/pgbouncer/pgbouncer.ini
            [databases]
            * = host=localhost port=5432
            [pgbouncer]
            listen_port = 6432
            listen_addr = localhost
            auth_type = trust
            auth_file = /etc/pgbouncer/userlist.txt
            logfile = pgbouncer.log
            pidfile = pgbouncer.pid
            admin_users = postgres
            EOF

            sudo systemctl stop pgbouncer

            pgbouncer -d /etc/pgbouncer/pgbouncer.ini

            psql -h localhost -U postgres -p 6432 pgbouncer -c 'show help'

      - name: Install requirements
        run: uv sync --all-extras -p ${{ matrix.python-version }}

      - name: Run unit tests
        run: uv run tox -e py${{ matrix.python-version }}

      - name: Run integration tests
        env:
            PGUSER: postgres
            PGPASSWORD: postgres
            TERM: xterm

        run: uv run tox -e integration

      - name: Check changelog for ReST compliance
        run: uv run tox -e rest

      - name: Run style checks
        run: uv run tox -e style