File: ci.yaml

package info (click to toggle)
python-django-cache-machine 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 228 kB
  • sloc: python: 1,143; makefile: 74
file content (86 lines) | stat: -rw-r--r-- 2,359 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
name: lint-test

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
  schedule:
    # run once a week on early monday mornings
    - cron: "22 2 * * 1"

jobs:
  pre-commit:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: pre-commit/action@v2.0.0

  test-job:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        # tox-gh-actions will only run the tox environments which match the currently
        # running python-version. See [gh-actions] in tox.ini for the mapping
        python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
    # Service containers to run with `test-job`
    services:
      memcached:
        image: memcached
        ports:
          - 11211:11211
      redis:
        image: redis
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 6379:6379
      postgres-default:
        image: postgres
        env:
          POSTGRES_USER: default
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # use port 5432 for default DB
          - 5432:5432
      postgres-primary2:
        image: postgres
        env:
          POSTGRES_USER: primary2
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # use port 5433 for primary2 DB
          - 5433:5432
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
          cache: "pip"
          cache-dependency-path: "**/dev-requirements.txt"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r dev-requirements.txt
      - name: Test with tox
        env:
          DATABASE_URL: postgres://default:postgres@localhost:5432/default
          DATABASE_URL_2: postgres://primary2:postgres@localhost:5433/primary2
        run: tox