3 on: [push, pull_request]
10 os: [ubuntu-latest, windows-latest]
11 python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
15 pip-cache-path: ~/.cache/pip
18 pip-cache-path: ~\AppData\Local\pip\Cache
20 name: Python ${{ matrix.python-version }} @ ${{ matrix.os-name }}
21 runs-on: ${{ matrix.os }}
26 - uses: ankane/setup-postgres@v1
27 - name: Setup Postgres user
29 sudo -u postgres psql --command="ALTER USER runner CREATEDB PASSWORD 'test'"
30 if: ${{ runner.os == 'Linux' }}
31 - name: Setup Postgres user
33 psql --command="CREATE USER runner CREATEDB PASSWORD 'test'"
34 if: ${{ runner.os == 'Windows' }}
37 - uses: actions/checkout@v2
38 - uses: actions/setup-python@v2
40 python-version: ${{ matrix.python-version }}
42 uses: actions/cache@v2
44 path: ${{ matrix.pip-cache-path }}
45 key: ${{ runner.os }}-pip
48 - name: Install dependencies
51 python -m pip install --upgrade "pip<21.0" "setuptools<45" wheel
53 pip install --upgrade virtualenv tox
57 pyver = '%d%d' % tuple(sys.version_info[:2])
58 toxenv = 'py%s' % pyver
59 toxenv += ',py%s-sqlite' % pyver
62 toxenv += ',py%s-postgres' % pyver
63 if os.name == 'posix':
64 toxenv += ',py%s-flake8' % pyver
67 with open(os.environ['GITHUB_ENV'], 'a') as f:
68 f.write('TOXENV=' + toxenv + '\n')
69 f.write('PGPASSWORD=test\n')
74 python -c "import os; print(os.environ['TOXENV'])"