Skip to content

new_get_quest_algorithm_1 #194

new_get_quest_algorithm_1

new_get_quest_algorithm_1 #194

Workflow file for this run

name: Check PR
on:
pull_request:
branches: [main]
types: [opened, synchronize]
paths:
- "**.py"
- "**.toml"
- "**.lock"
jobs:
tests:
strategy:
matrix:
POSTGRES_USER: [postgres]
POSTGRES_PASSWORD: [postgres]
POSTGRES_DB: [postgres]
python-version: ["3.10"]
poetry-version: ["1.5.1"]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
services:
mongo:
image: mongo:7.0
ports:
- 27017:27017
# options: --health-cmd "echo 'db.runCommand(\'ping\').ok' | mongo localhost:27017/productiondb --quiet" --health-interval 10s --health-timeout 5s --health-retries 5
postgres:
image: postgres:15
env:
POSTGRES_USER: ${{matrix.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{matrix.POSTGRES_PASSWORD}}
POSTGRES_DB: ${{matrix.POSTGRES_DB}}
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 6
steps:
- name: Checkout a Git repo
uses: actions/checkout@v3
- name: Cache deps
uses: actions/cache@v1
with:
path: ~/.cache/pypoetry/
key: python-deps-${{ hashFiles('**/poetry.lock') }}
- name: Installing Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Installing Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Installing Deps
run: poetry install
- name: Creating Private RSA Tokens
run: openssl genrsa -out jwt-private.pem 2048
- name: Creating Public RSA Tokens
run: openssl rsa -in jwt-private.pem -outform PEM -pubout -out jwt-public.pem
- name: Tests
run: poetry run pytest --cov=. --cov-report=term-missing:skip-covered --cov-branch --cov-report=xml tests
env:
DEBUG: True
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: ${{matrix.POSTGRES_DB}}
DB_USER: ${{matrix.POSTGRES_USER}}
DB_PASS: ${{matrix.POSTGRES_DB}}
TEST_DB_NAME:
MONGO_HOST: localhost
MONGO_PORT: '27017'
MONGO_DATABASE: mongodb
REDIS_HOST: localhost
REDIS_PORT: '6379'
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ACCESS_TOKEN_EXPIRES_IN: 15
REFRESH_TOKEN_EXPIRES_IN: 5000
ALGORITHM: RS256
COOKIE_ACCESS_TOKEN_KEY: mir
COOKIE_REFRESH_TOKEN_KEY: rsmir
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
lint:
needs: tests
strategy:
matrix:
python-version: ["3.10"]
poetry-version: ["1.5.1"]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout a Git repo
uses: actions/checkout@v3
- name: Cache deps
uses: actions/cache@v1
with:
path: ~/.cache/pypoetry/
key: python-deps-${{ hashFiles('**/poetry.lock') }}
- name: Installing Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Installing Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Linter
run: poetry run ruff check .