Skip to content

Changed pytest command #63

Changed pytest command

Changed pytest command #63

Workflow file for this run

name: Backend API
on:
push:
paths:
- "backend/**"
- ".github/workflows/backend.yml"
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
USE_S3: ${{ secrets.USE_S3 }}
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
REDIS_DB: ${{ secrets.REDIS_DB }}
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [3.10.0]
poetry-version: [1.7.1]
os: [windows-latest]
runs-on: windows-latest
defaults:
run:
working-directory: backend/
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.0
- name: Install poetry
run: |
python -m pip install poetry==1.7.1
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v2
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m poetry install
- name: Run tests
run: poetry run pytest -s
- name: Run tests with pytest
run: poetry run pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
code-quality:
strategy:
fail-fast: false
matrix:
python-version: [3.10.0]
poetry-version: [1.7.1]
os: [windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: backend/
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.0
- name: Install poetry
run: |
python -m pip install poetry==1.7.1
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v2
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m poetry install
- name: Run black
run: poetry run black .
- name: Run isort
run: poetry run isort . --profile black
- name: Run flake8
run: poetry run flake8 .
- name: Run bandit
run: poetry run bandit .