ci: added formatting workflow to slurm tuner

This commit is contained in:
Ceferino Patino 2025-02-13 09:41:35 -06:00
commit c307c06ea7
Signed by: c4patino
SSH key fingerprint: SHA256:Wu+cU1t+7zVT9wzew/4meNmeulo66NzMqc22MdDBgXI

39
.github/workflows/format.yml vendored Normal file
View file

@ -0,0 +1,39 @@
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]