-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (53 loc) · 1.65 KB
/
run_gravyvalet_tests.yml
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
name: run_gravyvalet_tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
run_gravyvalet_tests:
strategy:
fail-fast: false
matrix: # use to test upgrades before upgrading
python-version: ['3.12']
postgres-version: ['15']
runs-on: ubuntu-latest
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_HOST_AUTH_METHOD: trust
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: set up python${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
requirements/requirements.txt
requirements/dev-requirements.txt
- name: install py dependencies
run: pip install -r requirements/dev-requirements.txt
- name: set up pre-commit cache
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: run pre-commit checks
run: pre-commit run --all-files --show-diff-on-failure
- name: run tests
run: python3 manage.py test
env:
DEBUG: 1
POSTGRES_HOST: localhost
POSTGRES_DB: gravyvalettest
POSTGRES_USER: postgres
SECRET_KEY: oh-so-secret