Skip to content

Commit

Permalink
SW-4258 modify workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amrithvenkat committed Jan 17, 2024
1 parent ae9f66d commit 64882ad
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,4 @@ jobs:
path: pytest-report.html

format:
name: Check formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python ${{ inputs.python_v }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_v }}
- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit
pre-commit install
- name: Run pre-commit (all files)
run: |
if test -f ".pre-commit-config.yaml"
then
pre-commit run --all-files --show-diff-on-failure
else
echo "::warning::No pre-commit config available"
fi
uses: format.yml
35 changes: 35 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check formatting
on:
workfow_call:
inputs:
python_v:
description: "Python version needed to run the code, eg. 3.10.6"
default: 3.10.6
required: false
type: string

jobs:
format:
name: Check formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python ${{ inputs.python_v }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_v }}
- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit
pre-commit install
- name: Run pre-commit (all files)
run: |
if test -f ".pre-commit-config.yaml"
then
pre-commit run --all-files --show-diff-on-failure
else
echo "::warning::No pre-commit config available"
fi

0 comments on commit 64882ad

Please sign in to comment.