ci: added formatting workflow to slurm tuner
This commit is contained in:
parent
fa004278aa
commit
c307c06ea7
1 changed files with 39 additions and 0 deletions
39
.github/workflows/format.yml
vendored
Normal file
39
.github/workflows/format.yml
vendored
Normal 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]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue