Skip to content

CI-CD

CI-CD #5

Workflow file for this run

name: 'CI-CD'
on:
workflow_dispatch:
push:
branches:
- 'feature/**'
- 'fix/**'
pull_request:
branches:
- 'feature/**'
- 'fix/**'
jobs:
build:
name: 'Build πŸ—'
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- "3.12"
defaults:
run:
working-directory: ./
runs-on: ${{ matrix.os }}
steps:
- name: Check repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
code-quality:
name: 'Code-Quality πŸ’Ž'
needs: build
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- "3.12"
defaults:
run:
working-directory: ./
runs-on: ${{ matrix.os }}
steps:
- name: Check repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install Dependencies for Linting
run: |
pip install black
- name: Lint with Black
run: |
black .
- name: Lint with Isort
run: |
isort . --profile black
- name: Check repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install Dependencies for Testing
run: |
pip install pytest pytest-cov pytest-asyncio pytest pytest-xdist
- name: Test with Pytest-Cov
run: |
pytest --cov --cov-report xml .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: backend_app_tests
name: codecov-umbrella
verbose: true