Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,19 @@ jobs:
export PATH="$HOME/.local/bin:$PATH"
uv sync --dev
uv run pytest --cov=. --cov-report=xml:coverage.xml
- name: Get changed Python files
id: changed-files
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45
with:
files: |
**/*.py
- name: docstring test
if: steps.changed-files.outputs.any_changed == 'true'
run: |
# Get list of changed python files
pip install ruff
FILES=$(gh pr view ${{ github.event.pull_request.number }} --json files --jq '.files.[].path')
PYFILES=""
for _file in ${FILES}; do
echo "Checking file : $_file"
if [[ $(file --mime-type "$_file" | cut -d" " -f 2) == "text/x-script.python" ]]; then
PYFILES="$PYFILES $_file "
else
echo "Skipping non-python file: $_file"
fi
done
if [ -z "$PYFILES" ]; then
echo "No Python files changed."
else
echo "Running ruff on: $PYFILES"
ruff check --select D ${PYFILES}
fi
echo "Running ruff on changed Python files:"
echo "${{ steps.changed-files.outputs.all_changed_files }}"
ruff check --select D ${{ steps.changed-files.outputs.all_changed_files }}
Comment thread
midnightercz marked this conversation as resolved.
Comment thread
midnightercz marked this conversation as resolved.
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6
with:
Expand Down
Loading