Skip to content

Commit 715be91

Browse files
committed
test
1 parent 101280d commit 715be91

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,45 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18+
jobs:
19+
code-quality:
20+
name: code-quality
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: repository checkout step
24+
uses: actions/checkout@v5
25+
26+
- name: python environment step
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
31+
- name: install pre-commit
32+
run: python3 -m pip install pre-commit
33+
34+
- name: Checkout code
35+
uses: actions/checkout@v5
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Get changed files
40+
id: changed-files
41+
run: |
42+
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr '\n' ' ')
43+
echo "CHANGED_FILES=${CHANGED_FILES}" >> $GITHUB_ENV
44+
45+
- name: Print changed files
46+
run: |
47+
echo "Changed files:" && echo "$CHANGED_FILES" | tr ' ' '\n'
48+
49+
- name: Run pre-commit on changed files
50+
run: |
51+
if [ -n "$CHANGED_FILES" ]; then
52+
pre-commit run --color always --files $CHANGED_FILES --show-diff-on-failure
53+
else
54+
echo "No changed files to check."
55+
fi
56+
1857
test-no-extras:
1958
name: test-no-extras
2059
strategy:

0 commit comments

Comments
 (0)