55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
|
name: Lint project
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
|
||
|
jobs:
|
||
|
lint:
|
||
|
env:
|
||
|
RUNNER_TOOL_CACHE: /opt/hostedtoolcache
|
||
|
|
||
|
runs-on: ubuntu-latest
|
||
|
container:
|
||
|
image: catthehacker/ubuntu:act-22.04
|
||
|
|
||
|
steps:
|
||
|
- name: Checkout repository
|
||
|
uses: actions/checkout@v4
|
||
|
|
||
|
- name: Set up Python
|
||
|
uses: actions/setup-python@v5
|
||
|
with:
|
||
|
python-version: "3.12"
|
||
|
cache: 'pip'
|
||
|
env:
|
||
|
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
|
||
|
|
||
|
- name: Cache pre-commit hooks
|
||
|
id: cache-pre-commit
|
||
|
uses: actions/cache@v4
|
||
|
with:
|
||
|
path: ~/.cache/pre-commit
|
||
|
key: ${{ runner.os }}-pre-commit-cache
|
||
|
restore-keys: |
|
||
|
${{ runner.os }}-pre-commit-cache
|
||
|
|
||
|
- name: Install dependencies
|
||
|
run: |
|
||
|
python -m pip install --upgrade pip
|
||
|
pip install poetry
|
||
|
poetry install
|
||
|
poetry run pre-commit install
|
||
|
|
||
|
- name: Lint pre-commit
|
||
|
run: poetry run pre-commit run --all-files --hook-stage manual
|
||
|
|
||
|
- name: Run Telegram Notify Action
|
||
|
uses: proDreams/actions-telegram-notifier@v1
|
||
|
if: always()
|
||
|
with:
|
||
|
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||
|
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||
|
status: ${{ job.status }}
|
||
|
message: "Github Lkeep Lint"
|
||
|
notify_fields: "actor,repository,workflow"
|