mirror of
https://github.com/evroon/bracket.git
synced 2026-01-18 11:08:49 -05:00
77 lines
1.8 KiB
YAML
77 lines
1.8 KiB
YAML
name: backend
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- 'backend/**'
|
|
- 'codecov.yml'
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_USER: bracket_ci
|
|
POSTGRES_PASSWORD: bracket_ci
|
|
POSTGRES_DB: bracket_ci
|
|
ports:
|
|
- 5532:5432
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install pipenv
|
|
run: python3 -m pip install --upgrade pipenv wheel virtualenv
|
|
working-directory: backend
|
|
|
|
- id: cache-pipenv
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.local/share/virtualenvs
|
|
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
|
|
|
|
- name: Install dependencies
|
|
run: pipenv install -d
|
|
working-directory: backend
|
|
|
|
- name: Run tests
|
|
run: pipenv run pytest --cov --cov-report=xml .
|
|
working-directory: backend
|
|
env:
|
|
ENVIRONMENT: CI
|
|
|
|
- name: Upload coverage report to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
- name: Run mypy
|
|
run: pipenv run mypy --version && pipenv run mypy .
|
|
working-directory: backend
|
|
|
|
- name: Run pylint
|
|
run: pipenv run pylint bracket tests cli.py
|
|
working-directory: backend
|
|
|
|
- name: Run ruff format
|
|
run: pipenv run ruff format --check .
|
|
working-directory: backend
|
|
|
|
- name: Run ruff
|
|
run: pipenv run ruff check .
|
|
working-directory: backend
|
|
|
|
- name: Run vulture
|
|
run: '! pipenv run vulture |grep "unused function\|unused class\|unused method"'
|
|
working-directory: backend
|