name: Test package on: - push - pull_request jobs: build: runs-on: ubuntu-latest strategy: matrix: python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10'] services: postgres: image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres 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 steps: - uses: actions/checkout@v1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} cache: 'pip' - name: Install psycopg2 prerequisites run: sudo apt-get install libpq-dev - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements-test.txt pip install tox tox-gh-actions - name: Test with tox run: tox