Remove insecure auto-format label workflow (#20629)
This commit is contained in:
@@ -1,71 +0,0 @@
|
|||||||
name: Auto Format Code
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [labeled]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
auto-format:
|
|
||||||
if: github.event.label.name == 'format'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout PR branch
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
- name: Install pre-commit hook
|
|
||||||
run: |
|
|
||||||
python -m pip install pre-commit
|
|
||||||
pre-commit install
|
|
||||||
|
|
||||||
- name: Run pre-commit to format code
|
|
||||||
run: SKIP=no-commit-to-branch pre-commit run --all-files
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Check for changes
|
|
||||||
id: check_changes
|
|
||||||
run: |
|
|
||||||
if [[ -n $(git status -s) ]]; then
|
|
||||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
|
||||||
if: steps.check_changes.outputs.has_changes == 'true'
|
|
||||||
run: |
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git add .
|
|
||||||
git commit -m "🤖 Auto-format code with isort, black, ruff, and clang-format"
|
|
||||||
git push
|
|
||||||
|
|
||||||
- name: Remove format label
|
|
||||||
if: always()
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
script: |
|
|
||||||
try {
|
|
||||||
await github.rest.issues.removeLabel({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
name: 'format'
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.log('Label may have already been removed');
|
|
||||||
}
|
|
||||||
@@ -880,11 +880,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
bash scripts/ci/cuda/ci_install_dependency.sh
|
bash scripts/ci/cuda/ci_install_dependency.sh
|
||||||
|
|
||||||
- name: Run benchmark smoke tests
|
- name: Run benchmark tests
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
run: |
|
run: |
|
||||||
cd python/sglang/jit_kernel/benchmark
|
cd python/sglang/jit_kernel/benchmark
|
||||||
echo "Running jit-kernel benchmark smoke tests in CI mode..."
|
echo "Running jit-kernel benchmark tests in CI mode..."
|
||||||
|
|
||||||
failures=()
|
failures=()
|
||||||
|
|
||||||
@@ -898,11 +898,11 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ ${#failures[@]} -ne 0 ]; then
|
if [ ${#failures[@]} -ne 0 ]; then
|
||||||
echo "The following benchmark smoke tests failed: ${failures[*]}"
|
echo "The following benchmark tests failed: ${failures[*]}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "All jit-kernel benchmark smoke tests completed successfully!"
|
echo "All jit-kernel benchmark tests completed successfully!"
|
||||||
|
|
||||||
# =============================================== primary ====================================================
|
# =============================================== primary ====================================================
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user