Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
tilelang
Commits
562796ef
Unverified
Commit
562796ef
authored
Jul 29, 2025
by
Wenhao Xie
Committed by
GitHub
Jul 29, 2025
Browse files
[CI] Improve format check output and automate commit of changes (#669)
* update format check ci * upd * upd
parent
8ea00774
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
38 deletions
+28
-38
.github/workflows/ci.yml
.github/workflows/ci.yml
+28
-29
format.sh
format.sh
+0
-9
No files found.
.github/workflows/ci.yml
View file @
562796ef
name
:
CI
name
:
CI
on
:
[
pull_request
]
on
:
[
pull_request
_target
]
env
:
env
:
PYTHON_VERSION
:
'
3.9'
PYTHON_VERSION
:
'
3.9'
...
@@ -7,57 +7,56 @@ env:
...
@@ -7,57 +7,56 @@ env:
jobs
:
jobs
:
format-check
:
format-check
:
runs-on
:
self-hosted
runs-on
:
[
ubuntu-latest
,
self-hosted
]
permissions
:
contents
:
write
steps
:
steps
:
-
name
:
Checkout repository
-
name
:
Checkout repository
uses
:
actions/checkout@v
2
uses
:
actions/checkout@v
4
with
:
with
:
fetch-depth
:
0
fetch-depth
:
0
repository
:
${{ github.event.pull_request.head.repo.full_name }}
ref
:
${{ github.event.pull_request.head.ref }}
token
:
${{ secrets.PAT }}
-
name
:
Set up Python
-
name
:
Set up Python
uses
:
actions/setup-python@v2
uses
:
actions/setup-python@v2
with
:
with
:
python-version
:
${{ env.PYTHON_VERSION }}
python-version
:
${{ env.PYTHON_VERSION }}
-
name
:
E
ns
ure venv (local & persistent)
-
name
:
I
ns
tall dependencies
run
:
|
run
:
|
set -e
python -m pip install --upgrade pip
REQS_HASH=$(cat requirements-test.txt 2>/dev/null || true)
pip install yapf==0.40.2 toml==0.10.2 tomli==2.0.1 ruff==0.6.5 codespell==2.3.0 clang-format==15.0.7
MARKER="${{ runner.tool_cache }}/.venv_marker_${{ env.PYTHON_VERSION }}_${REQS_HASH:0:8}"
if [[ -f "$MARKER" ]] && [[ -f "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" ]]; then
echo "venv exists and hash matches – reuse it"
else
echo "venv stale or missing – recreating"
rm -rf "${{ runner.tool_cache }}/${{ env.VENV_DIR }}" "$MARKER"
python -m venv "${{ runner.tool_cache }}/${{ env.VENV_DIR }}"
# shellcheck source=/dev/null
source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate"
python -m pip install --upgrade pip --no-user
[[ -f requirements-test.txt ]] && \
PIP_NO_BUILD_ISOLATION=1 pip install -r requirements-test.txt --no-user
pip install . --no-user
touch "$MARKER"
fi
-
name
:
Update submodules
run
:
git submodule update --init --recursive
-
name
:
Run format check
-
name
:
Run format check
run
:
|
run
:
|
source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate"
git clone https://github.com/tile-ai/tilelang.git main_repo
./format.sh
cp main_repo/format.sh .
rm -rf main_repo
if ! output=$(./format.sh 2>&1); then
printf '%s\n' "$output" | grep "Please review and stage the changes."
fi
-
name
:
Commit and Push Changes
uses
:
stefanzweifel/git-auto-commit-action@v5
with
:
commit_message
:
"
lint"
build-test
:
build-test
:
runs-on
:
self-hosted
runs-on
:
self-hosted
needs
:
format-check
needs
:
format-check
permissions
:
contents
:
read
steps
:
steps
:
-
name
:
Checkout repository
-
name
:
Checkout repository
uses
:
actions/checkout@v
2
uses
:
actions/checkout@v
4
with
:
with
:
fetch-depth
:
0
fetch-depth
:
0
repository
:
${{ github.event.pull_request.head.repo.full_name }}
ref
:
${{ github.event.pull_request.head.ref }}
-
name
:
Set up Python
-
name
:
Set up Python
uses
:
actions/setup-python@v2
uses
:
actions/setup-python@v2
...
...
format.sh
View file @
562796ef
...
@@ -255,13 +255,4 @@ if ! git diff --quiet &>/dev/null; then
...
@@ -255,13 +255,4 @@ if ! git diff --quiet &>/dev/null; then
exit
1
exit
1
fi
fi
if
!
git diff
--quiet
&>/dev/null
;
then
echo
'Reformatted files. Please review and stage the changes.'
echo
'Changes not staged for commit:'
echo
git
--no-pager
diff
--name-only
exit
1
fi
echo
'tile-lang: All checks passed'
echo
'tile-lang: All checks passed'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment