From c307c06ea75d94f31243589e37f1285b0ab13229 Mon Sep 17 00:00:00 2001 From: C4 Patino Date: Thu, 13 Feb 2025 09:41:35 -0600 Subject: [PATCH] ci: added formatting workflow to slurm tuner --- .github/workflows/format.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..e4fe290 --- /dev/null +++ b/.github/workflows/format.yml @@ -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]