Add LIT test for gfx1201 backend bug #205
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Lint and Format Check | |
on: | |
pull_request: | |
branches: | |
- develop | |
- 'release/**' | |
paths: | |
- "mlir/**" | |
- "external/**" | |
- "!external/llvm-project/**" | |
push: | |
branches: | |
- develop | |
- 'release/**' | |
paths: | |
- "mlir/**" | |
- "external/**" | |
- "!external/llvm-project/**" | |
jobs: | |
py-checks: | |
if: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 yapf pep8-naming | |
- name: Get changed Python files under mlir/ | |
id: changes | |
shell: bash | |
run: | | |
if [ "${{ github.event_name }}" = "pull_request" ]; then | |
BASE_SHA="${{ github.event.pull_request.base.sha }}" | |
else | |
BASE_SHA="${{ github.event.before }}" | |
fi | |
HEAD_SHA="${{ github.sha }}" | |
# list added/modified files, restrict to mlir/**/*.py | |
files=$(git diff --name-only --diff-filter=AM "$BASE_SHA" "$HEAD_SHA" \ | |
| grep -E '^mlir/.*\.py$' || true) | |
echo "files<<EOF" >> $GITHUB_OUTPUT | |
echo "$files" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
echo "Changed files:" | |
echo "$files" | |
- name: Run flake8 | |
if: steps.changes.outputs.files != '' | |
run: | | |
flake8 --ignore=E501 ${{ steps.changes.outputs.files }} | |
- name: Run YAPF check | |
if: steps.changes.outputs.files != '' | |
run: | | |
# --diff prints a unified diff and returns non-zero if changes would be made | |
yapf --diff ${{ steps.changes.outputs.files }} \ | |
|| (echo "Format issues found. Fix locally with: yapf -i <files>"; exit 1) | |
- name: No Python changes in mlir/ | |
if: steps.changes.outputs.files == '' | |
run: echo "No changed *.py files under mlir/ – skipping." |