Skip to content

undo

undo #186

Workflow file for this run

name: Run Tests via Pytest
on:
pull_request_target:
branches:
- "**"
push:
branches:
- "**"
jobs:
build:
name: Build and Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout code (PR)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout code (Push)
if: github.event_name == 'push'
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pipx install poetry==1.7.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: |
poetry install --sync
- name: Test with pytest
env:
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
MONGO_HOST: ${{ secrets.MONGO_HOST }}
MONGO_PORT: ${{ secrets.MONGO_PORT }}
MONGO_USER: ${{ secrets.MONGO_USER }}
MONGO_PASSWORD: ${{ secrets.MONGO_PASSWORD }}
run: |
poetry run coverage run -m pytest -v -s
- name: Generate Coverage Report
run: |
poetry run coverage report -m