Skip to content

Commit 1505045

Browse files
committed
Install ast-grep before Python CI validation
1 parent 1b60f7f commit 1505045

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

‎.github/workflows/check.yml‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,7 @@ jobs:
3434
python-version: "3.14"
3535
enable-cache: true
3636
- name: Install ast-grep
37-
run: |
38-
curl --fail --location --retry 3 \
39-
https://github.com/ast-grep/ast-grep/releases/download/0.40.5/app-x86_64-unknown-linux-gnu.zip \
40-
--output "$RUNNER_TEMP/ast-grep.zip"
41-
printf '%s %s\n' \
42-
'9715cb5933a4d7fe9e4d8c2be870a9a82840c3f2ec4a57bdff7f15d0912cc676' \
43-
"$RUNNER_TEMP/ast-grep.zip" | sha256sum --check
44-
mkdir -p "$RUNNER_TEMP/ast-grep"
45-
unzip -j "$RUNNER_TEMP/ast-grep.zip" ast-grep -d "$RUNNER_TEMP/ast-grep"
46-
echo "$RUNNER_TEMP/ast-grep" >> "$GITHUB_PATH"
37+
run: bash tooling/comment-policy/install-ci-ast-grep.sh
4738
- run: uv sync --locked
4839
- run: uv run python tooling/comment-policy/check.py
4940
- run: uv run pytest -o addopts= tooling/comment-policy/tests/test_check.py
@@ -60,6 +51,8 @@ jobs:
6051
version: "0.13.6"
6152
python-version: "3.14"
6253
enable-cache: true
54+
- name: Install ast-grep
55+
run: bash tooling/comment-policy/install-ci-ast-grep.sh
6356
- run: uv sync --locked
6457
- run: uv run rua-dev validate --lane python
6558
- run: uv lock --check --project examples/python
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
curl --fail --location --retry 3 \
5+
https://github.com/ast-grep/ast-grep/releases/download/0.40.5/app-x86_64-unknown-linux-gnu.zip \
6+
--output "$RUNNER_TEMP/ast-grep.zip"
7+
printf '%s %s\n' \
8+
'9715cb5933a4d7fe9e4d8c2be870a9a82840c3f2ec4a57bdff7f15d0912cc676' \
9+
"$RUNNER_TEMP/ast-grep.zip" | sha256sum --check
10+
mkdir -p "$RUNNER_TEMP/ast-grep"
11+
unzip -j "$RUNNER_TEMP/ast-grep.zip" ast-grep -d "$RUNNER_TEMP/ast-grep"
12+
echo "$RUNNER_TEMP/ast-grep" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)