ВСК-35 Добавление pre-commit #314
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: fastapi-app workflow | |
on: | |
push: | |
branches: [ "develop" ] | |
pull_request: | |
branches: [ "develop" ] | |
workflow_dispatch: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: Lint and Pytest | |
steps: | |
- name: Check out source repository | |
uses: actions/checkout@v3 | |
- name: Set up Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: flake8 Lint | |
uses: py-actions/flake8@v2 | |
with: | |
path: "app" | |
args: "--config setup.cfg" | |
- uses: isort/isort-action@master | |
with: | |
configuration: .setup.cfg | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r app/requirements.txt | |
- name: Test with pytest | |
env: | |
EMAIL_FROM: ${{ secrets.EMAIL_FROM }} | |
EMAIL_HOST: ${{ secrets.EMAIL_HOST }} | |
EMAIL_PORT: ${{ secrets.EMAIL_PORT }} | |
EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} | |
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} | |
run: | | |
pytest |