@@ -25,53 +25,20 @@ jobs:
2525 runs-on : ubuntu-24.04
2626 timeout-minutes : 30
2727 steps :
28- - name : Checkout torch-xpu-ops
28+ - name : Checkout Repository
2929 uses : actions/checkout@v4
30- with :
31- path : torch-xpu-ops
32- - name : Run lint check
33- run : |
34- cd ./torch-xpu-ops
35- lint_script=".github/scripts/lintrunner.sh"
36- ci_report="${{ github.workspace }}/torch-xpu-ops/.ci/templates/ci-report.txt"
37- sed -i 's+GITHUB_REPOSITORY+${{ github.repository }}+;s+GITHUB_RUN_ID+${{ github.run_id }}+' ${ci_report}
38- # Run lint check with proper error handling and reporting
39- export ADDITIONAL_LINTRUNNER_ARGS="--skip CLANGTIDY,CLANGFORMAT,MERGE_CONFLICTLESS_CSV --all-files"
40- if bash "$lint_script"; then
41- sed -i 's+.*Lnit Check.*+|**Lnit Check**|✅|1|100%|N/A|N/A|+' "$ci_report"
42- echo "Lint check: PASSED"
43- else
44- sed -i 's+.*Lnit Check.*+|**Lnit Check**|❌|1|0%|N/A|N/A|+' "$ci_report"
45- echo "Lint check: FAILED"
46- exit 1
47- fi
48- - name : Run lint check with Clang
30+
31+ - name : Setup Linting Environment
4932 run : |
50- sudo apt update && sudo apt install -y libomp-dev
51- rm -rf pytorch
52- git clone https://github.com/pytorch/pytorch pytorch
53- cd pytorch && cp -r ../torch-xpu-ops third_party/
54- export ADDITIONAL_LINTRUNNER_ARGS="--take CLANGTIDY,CLANGFORMAT \
55- build/xpu/**/*.* \
56- build/xpu/*.* \
57- third_party/torch-xpu-ops/src/*.* \
58- third_party/torch-xpu-ops/src/**/*.* \
59- third_party/torch-xpu-ops/src/**/**/*.* \
60- third_party/torch-xpu-ops/src/**/**/**/*.*"
61- export CLANG=1
62- # Run lint check with proper error handling and reporting
63- lint_script="third_party/torch-xpu-ops/.github/scripts/lintrunner.sh"
64- ci_report="${{ github.workspace }}/torch-xpu-ops/.ci/templates/ci-report.txt"
65- if bash "$lint_script"; then
66- sed -i 's+.*Clang Check.*+|**Clang Check**|✅|1|100%|N/A|N/A|+' "$ci_report"
67- echo "Lint check: PASSED"
68- else
69- sed -i 's+.*Clang Check.*+|**Clang Check**|❌|1|0%|N/A|N/A|+' "$ci_report"
70- echo "Lint check: FAILED"
71- exit 1
72- fi
73- - name : Init test summary result
74- uses : ./torch-xpu-ops/.github/actions/add-comment
33+ sudo apt-get update
34+ sudo apt-get install -y libomp-dev dos2unix
35+
36+ - name : Run Code Quality Checks
37+ id : lint-checks
38+ uses : ./.github/actions/lint-checks
39+
40+ - name : Initialize Test Summary
41+ uses : ./.github/actions/add-comment
7542 with :
7643 commentBody : .ci/templates/ci-report.txt
7744
0 commit comments