39 lines
972 B
YAML
39 lines
972 B
YAML
name: yapf
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
tags: ["v*.*.*"]
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
branches: ["*"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
format:
|
|
timeout-minutes: 15
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5.1.1
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Display Python python-version
|
|
run: python -c 'import sys; print(sys.version)'
|
|
- name: Install yapf
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install yapf
|
|
- name: Format all files
|
|
run: yapf --in-place --parallel --recursive --exclude .venv .
|
|
- name: Commit changes
|
|
uses: stefanzweifel/git-auto-commit-action@v5.0.1
|
|
with:
|
|
commit_message: |
|
|
Autoformatting with yapf
|
|
|
|
[skip ci]
|