1 name: Pull Request Build
3 on: [pull_request, workflow_dispatch]
13 POSTGRES_DB: mygpo_test
14 POSTGRES_PASSWORD: runner
19 - uses: actions/checkout@v2
21 - name: Setup Python ${{ matrix.python-version }}
22 uses: actions/setup-python@v2
24 python-version: ${{ matrix.python-version }}
26 - name: Install dependencies
28 sudo apt-get update -q
30 python -m pip install --upgrade pip
32 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33 if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
34 - name: Setup PostgreSQL
36 sudo sed -i -e '/local.*peer/s/runner/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
37 sudo service postgresql restart
39 sudo -u postgres psql -c "CREATE USER runner WITH PASSWORD 'runner';"
40 sudo -u postgres psql -c "CREATE DATABASE mygpo_test OWNER runner;"
42 - name: Check Format and Coverage
44 make check-code-format
45 python -m pytest --cov=mygpo/ --cov-branch