3 on: [push, pull_request]
10 python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
12 name: Python ${{ matrix.python-version }}
13 runs-on: ubuntu-latest
17 # Use preinstalled PostgreSQL
18 - name: Start PostgreSQL on Ubuntu
20 sudo systemctl start postgresql
24 echo 'localhost:*:test:runner:test' > ~/.pgpass
25 chmod u=rw,go= ~/.pgpass
26 sudo -u postgres psql --command="CREATE USER runner CREATEDB ENCRYPTED PASSWORD 'test'"
28 - uses: actions/checkout@v2
29 - uses: actions/setup-python@v2
31 python-version: ${{ matrix.python-version }}
33 uses: actions/cache@v2
35 # This path is specific to Linux/Unix
37 key: ${{ runner.os }}-pip
38 - name: Install dependencies
41 python -m pip install --upgrade "pip<21.0" "setuptools<45" wheel
43 pip install --upgrade virtualenv tox
47 pyver = '%d%d' % tuple(sys.version_info[:2])
48 toxenv = 'py%s' % pyver
49 toxenv += ',py%s-sqlite' % pyver
50 toxenv += ',py%s-postgres' % pyver
51 toxenv += ',py%s-flake8' % pyver
52 with open(os.environ['GITHUB_ENV'], 'a') as f:
53 f.write('TOXENV=' + toxenv + '\n')
57 python -c "import os; print(os.environ['TOXENV'])"