feat: send alert image with telegram message, if requested #261
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: style | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
jobs: | |
ruff: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: x64 | |
- name: Run ruff | |
run: | | |
pip install ruff==0.0.278 | |
ruff --version | |
ruff check --diff . | |
mypy: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: x64 | |
- uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: "1.3.0" | |
- name: Resolve dependencies | |
run: poetry export -f requirements.txt --without-hashes --output src/app/requirements.txt | |
- name: Cache python modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('src/app/requirements.txt') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r src/app/requirements.txt --upgrade | |
pip install "mypy==1.4.1" types-requests types-python-dateutil types-passlib types-python-jose sqlalchemy-stubs | |
- name: Run mypy | |
run: | | |
mypy --version | |
mypy | |
mypy-client: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: x64 | |
- name: Cache python modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('client/pyproject.toml') }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e client/. --upgrade | |
pip install "mypy==1.4.1" | |
- name: Run mypy | |
run: | | |
mypy --version | |
cd client && mypy | |
black: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: x64 | |
- name: Install deps | |
run: pip install "black==23.3.0" | |
- name: Run black | |
run: | | |
black --version | |
black --check --diff . | |
bandit: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: x64 | |
- name: Run bandit | |
run: | | |
pip install bandit[toml] | |
bandit --version | |
bandit -r . -c pyproject.toml |