File: test-pg.yml

package info (click to toggle)
python-django-hashids 0.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 180 kB
  • sloc: python: 394; makefile: 3
file content (68 lines) | stat: -rw-r--r-- 1,714 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
name: test-pg

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test-pg:
    runs-on: ubuntu-24.04
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.12]
        django-version: [4.2.9, 5.0.1]
        include:
          - python-version: "3.9"
            django-version: "2.2.13"
          - python-version: "3.9"
            django-version: "3.2.4"

    env:
      POSTGRES_PASSWORD: postgres
      POSTGRES_USER: postgres
      POSTGRES_DB: postgres
      POSTGRES_HOST: 127.0.0.1
      TEST_WITH_PG: true

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

    steps:
      - uses: actions/checkout@v1
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install tooling
        run: |
          python -mpip install poetry codecov
      - name: Install dependencies
        run: |
          poetry install --with testpg,dev
      - name: Setup Django ${{ matrix.django-version }}
        run: |
          poetry run pip install django==${{ matrix.django-version }}
      - name: Test with pytest
        run: |
          poetry run py.test --cov=./django_hashids/ --no-migrations
      - name: Upload coverage to codecov
        run: |
          codecov
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}