feat: send alert image with telegram message, if requested #378
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.9] | |
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.290 | |
ruff --version | |
ruff check --diff . | |
mypy: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.9] | |
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.6.1" | |
- name: Resolve dependencies | |
run: poetry export -f requirements.txt --without-hashes --with quality --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 | |
- name: Run mypy | |
run: | | |
mypy --version | |
mypy | |
mypy-client: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: [3.9] | |
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.9] | |
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.9] | |
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 |