This repository has been archived by the owner on Aug 8, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (98 loc) · 3.39 KB
/
check_constraints.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: django check constraint test.
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# os: ubuntu-latest
# os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.5, 3.6, 3.7, 3.8, pypy3]
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: ''
POSTGRES_DB: test
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:8.0.18
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
id: Linux-pip-cache
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v1
id: macOS-pip-cache
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v1
id: Windows-pip-cache
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v1
id: Linux-nox-cache
if: startsWith(runner.os, 'Linux')
with:
path: .nox
key: ${{ runner.os }}-nox-${{ hashFiles('noxfile.py') }}
restore-keys: |
${{ runner.os }}-nox-
- uses: actions/cache@v1
id: macOS-nox-cache
if: startsWith(runner.os, 'macOS')
with:
path: .nox
key: ${{ runner.os }}-nox-${{ hashFiles('noxfile.py') }}
restore-keys: |
${{ runner.os }}-nox-
- uses: actions/cache@v1
id: Windows-nox-cache
if: startsWith(runner.os, 'Windows')
with:
path: .nox
key: ${{ runner.os }}-nox-${{ hashFiles('noxfile.py') }}
restore-keys: |
${{ runner.os }}-nox-
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
# if: steps.Linux-pip-cache.outputs.cache-hit != 'true'
run: make install-test
- name: Test with nox
run: |
sudo apt-get install -y --no-install-recommends libpq-dev mysql-client mysql-server libmysqlclient-dev
make nox
env:
# use postgres for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be localhost
POSTGRES_HOST: postgres
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
POSTGRES_USER: test_user
POSTGRES_DB: test
MYSQL_ROOT_PASSWORD: password
MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}