Unverified Commit 9a7cda42 authored by Xuehai Pan's avatar Xuehai Pan Committed by GitHub
Browse files

[CI] auto-cancel in-progress PR CI when new commits are pushed (#956)

parent 07f62104
name: CI Test on AMD name: CI Test on AMD
on: [pull_request] on: [pull_request]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env: env:
PYTHON_VERSION: '3.12' PYTHON_VERSION: '3.12'
VENV_DIR: tilelang_ci VENV_DIR: tilelang_ci
...@@ -11,7 +15,7 @@ jobs: ...@@ -11,7 +15,7 @@ jobs:
runs-on: [self-hosted, amd, gpu] runs-on: [self-hosted, amd, gpu]
permissions: permissions:
contents: write contents: write
steps: steps:
- name: Checkout repository - name: Checkout repository
...@@ -84,7 +88,7 @@ jobs: ...@@ -84,7 +88,7 @@ jobs:
set -e set -e
REQS_HASH=$(sha256sum requirements-rocm.txt | cut -d ' ' -f 1) REQS_HASH=$(sha256sum requirements-rocm.txt | cut -d ' ' -f 1)
MARKER="${{ runner.tool_cache }}/.venv_marker_${{ env.PYTHON_VERSION }}_${REQS_HASH:0:8}" MARKER="${{ runner.tool_cache }}/.venv_marker_${{ env.PYTHON_VERSION }}_${REQS_HASH:0:8}"
echo "Installing requirements" echo "Installing requirements"
if [[ -f "$MARKER" ]] && [[ -f "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" ]]; then if [[ -f "$MARKER" ]] && [[ -f "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" ]]; then
echo "venv exists and hash matches – reuse it" echo "venv exists and hash matches – reuse it"
......
name: Bot name: Bot
on: on:
issue_comment: issue_comment:
types: [created] types: [created]
...@@ -36,7 +36,7 @@ jobs: ...@@ -36,7 +36,7 @@ jobs:
- name: Build original version - name: Build original version
run: | run: |
echo "Check files to be deleted!" echo "Check files to be deleted!"
git clean -dxn | grep -v 'tll/' | xargs -I{} echo {} git clean -dxn | grep -v 'tll/' | xargs -I{} echo {}
git clean -dxn | grep -v 'tll/' | xargs -I{} rm -rf {} git clean -dxn | grep -v 'tll/' | xargs -I{} rm -rf {}
echo "Delete files completed!" echo "Delete files completed!"
git checkout main git checkout main
......
name: CI name: CI
on: [pull_request] on: [pull_request]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env: env:
PYTHON_VERSION: '3.12' PYTHON_VERSION: '3.12'
VENV_DIR: tilelang_ci VENV_DIR: tilelang_ci
...@@ -10,7 +14,7 @@ jobs: ...@@ -10,7 +14,7 @@ jobs:
runs-on: [self-hosted, nvidia] runs-on: [self-hosted, nvidia]
permissions: permissions:
contents: write contents: write
steps: steps:
- name: Checkout repository - name: Checkout repository
......
name: CI Test on Metal name: CI Test on Metal
on: [pull_request] on: [pull_request]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env: env:
PYTHON_VERSION: '3.12' PYTHON_VERSION: '3.12'
VENV_DIR: tilelang_ci VENV_DIR: tilelang_ci
...@@ -10,7 +14,7 @@ jobs: ...@@ -10,7 +14,7 @@ jobs:
runs-on: [macos-latest] runs-on: [macos-latest]
permissions: permissions:
contents: write contents: write
steps: steps:
- name: Checkout repository - name: Checkout repository
......
...@@ -41,4 +41,3 @@ jobs: ...@@ -41,4 +41,3 @@ jobs:
else else
echo "No changes detected, skipping commit and push." echo "No changes detected, skipping commit and push."
fi fi
...@@ -20,4 +20,4 @@ jobs: ...@@ -20,4 +20,4 @@ jobs:
'🚀' '🚀'
}) })
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment