mirror of
https://github.com/evroon/bracket.git
synced 2026-02-01 18:11:24 -05:00
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: backend
|
|
|
|
on: [push, workflow_dispatch]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.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@v3
|
|
|
|
- name: Install pipenv
|
|
run: python3 -m pip install --upgrade pipenv wheel virtualenv
|
|
working-directory: backend
|
|
|
|
- id: cache-pipenv
|
|
uses: actions/cache@v3
|
|
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@v3
|
|
|
|
- name: Run mypy
|
|
run: pipenv run mypy --version && pipenv run mypy .
|
|
working-directory: backend
|
|
|
|
- name: Run pylint
|
|
run: pipenv run pylint alembic bracket tests
|
|
working-directory: backend
|
|
|
|
- name: Run black
|
|
run: pipenv run black --check .
|
|
working-directory: backend
|