mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-22 13:38:43 +00:00
36 lines
877 B
YAML
36 lines
877 B
YAML
name: Pre-commit Checks
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [master, main]
|
|
push:
|
|
branches: [master, main]
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.10'
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pre-commit
|
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
|
|
- name: Run pre-commit hooks
|
|
run: |
|
|
pre-commit run --all-files --show-diff-on-failure
|
|
|
|
- name: Cache pre-commit hooks
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pre-commit
|
|
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} |