Skip to content

pip-compile --upgrade requirements #272

pip-compile --upgrade requirements

pip-compile --upgrade requirements #272

# This workflow runs pytest on the service code
name: Pytest Pull Request workflow
on:
pull_request:
branches: [ master ]
#set environment variables
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
APP_NAME: async-url-shortener
IMAGE_NAME: shortener
jobs:
pytest_with_coverage:
# Run pytest, upload coverage to a githubs gist so that badge can display it
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pass
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest --cov=shortener
env:
DB_HOST: localhost
DB_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
DB_DATABASE: postgres
DB_USER: postgres
DB_PASSWORD: pass