Skip to content

Commit 70c0fa1

Browse files
committed
[GitHub][CI] Add pip cache and enable hard failure in lint-helper.py
1 parent b81d4d2 commit 70c0fa1

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

.github/workflows/pr-code-lint.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,27 @@ jobs:
5757
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
5858
sparse-checkout-cone-mode: false
5959
path: code-lint-tools
60-
61-
- name: Install python
62-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
63-
with:
64-
python-version: '3.12'
6560

66-
- name: Install python dependencies
67-
run: python3 -m pip install -r code-lint-tools/llvm/utils/git/requirements_linting.txt
68-
6961
- name: Install clang-tidy
7062
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
7163
with:
7264
clang-tidy: 20.1.8
65+
66+
- name: Clear Python cache
67+
run: sudo rm -rf /__t/Python
68+
69+
- name: Setup Python env
70+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
71+
with:
72+
python-version: '3.12'
73+
cache: 'pip'
74+
cache-dependency-path: 'code-lint-tools/llvm/utils/git/requirements_linting.txt'
75+
76+
- name: Install Python dependencies
77+
run: pip install -r code-lint-tools/llvm/utils/git/requirements_linting.txt
7378

74-
# FIXME: create special mapping for 'gen' targets, for now build predefined set
79+
# TODO: create special mapping for 'codegen' targets, for now build predefined set
80+
# TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies
7581
- name: Configure and CodeGen
7682
run: |
7783
git config --global --add safe.directory '*'

llvm/utils/git/code-lint-helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import argparse
2121
import os
2222
import subprocess
23+
import sys
2324
from typing import List, Optional
2425

2526

@@ -325,5 +326,4 @@ def run_linter(changed_files: List[str], args: LintArgs) -> tuple[bool, Optional
325326

326327
if not success:
327328
print("error: some linters failed: clang-tidy")
328-
# Do not fail job for as it may be unstable
329-
# sys.exit(1)
329+
sys.exit(1)

0 commit comments

Comments
 (0)