Skip to content

Commit 6675137

Browse files
committed
test
1 parent cea1f07 commit 6675137

File tree

2 files changed

+96
-16
lines changed

2 files changed

+96
-16
lines changed

.github/workflows/mlir-tensorrt-build-test.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
pull_request:
66
push:
7-
branches:
7+
branches:
88
- main
99
- nightly
1010
- release/*
@@ -18,19 +18,6 @@ jobs:
1818
steps:
1919
- name: checkout TensorRT-Incubator
2020
uses: actions/checkout@v4
21-
- name: python format and clang check
22-
run: |
23-
set -eou pipefail
24-
set -x
25-
python3 -m pip install black
26-
python3 -m black --check --extend-exclude='.*\.pyi' mlir-tensorrt/compiler/
27-
python3 -m black --check --extend-exclude='.*\.pyi' mlir-tensorrt/integrations/python/
28-
git clang-format HEAD~1 --diff
29-
if [ $? -ne 0 ]; then
30-
echo "Python format and clang check failed"
31-
exit 1
32-
fi
33-
echo "Python format and clang check passed"
3421
- name: Generate matrix
3522
id: generate
3623
run: |
@@ -46,12 +33,32 @@ jobs:
4633
matrix:
4734
${{ fromJson(needs.generate-matrix.outputs.matrix) }}
4835
runs-on: [linux-amd64-gpu-h100-latest-1]
49-
container:
36+
container:
5037
image: ${{ matrix.docker_image }}
5138
options: '--gpus all'
5239
steps:
40+
- name: clean workspace
41+
run: |
42+
set -eou pipefail
43+
set -x
44+
echo "cleaning up ${GITHUB_WORKSPACE}"
45+
rm -rf ${GITHUB_WORKSPACE}
46+
mkdir -p ${GITHUB_WORKSPACE}
5347
- name: checkout TensorRT-Incubator
5448
uses: actions/checkout@v4
49+
- name: python format and clang check
50+
run: |
51+
set -eou pipefail
52+
set -x
53+
python3 -m pip install black
54+
python3 -m black --check --extend-exclude='.*\.pyi' mlir-tensorrt/compiler/
55+
python3 -m black --check --extend-exclude='.*\.pyi' mlir-tensorrt/integrations/python/
56+
git clang-format HEAD~1 --diff
57+
if [ $? -ne 0 ]; then
58+
echo "Python format and clang check failed"
59+
exit 1
60+
fi
61+
echo "Python format and clang check passed"
5562
- name: create cache folder
5663
run: |
5764
set -eou pipefail
@@ -108,4 +115,7 @@ jobs:
108115
cd mlir-tensorrt
109116
python3 -m pip install .private.wheels/mlir_tensorrt-*.whl
110117
# TODO: add smoke test for the wheel
111-
118+
119+
concurrency:
120+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-tensorrt-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}-${{ inputs.job-name }}
121+
cancel-in-progress: true
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
exclude: ^.github/actions/assigner/dist
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: check-yaml
7+
- id: trailing-whitespace
8+
exclude: ^docs
9+
- id: check-added-large-files
10+
args:
11+
- --maxkb=1000
12+
- id: check-vcs-permalinks
13+
- id: check-merge-conflict
14+
- id: mixed-line-ending
15+
args:
16+
- --fix=lf
17+
exclude: ^docs
18+
- repo: https://github.com/pre-commit/mirrors-clang-format
19+
rev: v14.0.6
20+
hooks:
21+
- id: clang-format
22+
types_or: [c++, c, cuda]
23+
- repo: https://github.com/keith/pre-commit-buildifier
24+
rev: 8.0.3
25+
hooks:
26+
- id: buildifier
27+
args:
28+
- --warnings=all
29+
- id: buildifier-lint
30+
- repo: https://github.com/abravalheri/validate-pyproject
31+
rev: v0.24.1
32+
hooks:
33+
- id: validate-pyproject
34+
- repo: https://github.com/pycqa/isort
35+
rev: 6.0.0
36+
hooks:
37+
- id: isort
38+
name: isort (python)
39+
- repo: https://github.com/pre-commit/mirrors-mypy
40+
rev: "v1.15.0"
41+
hooks:
42+
- id: mypy
43+
files: "^(integrations/python|tensorrt/python)/.*\\.py$"
44+
- repo: https://github.com/astral-sh/ruff-pre-commit
45+
# Ruff version.
46+
rev: v0.11.7
47+
hooks:
48+
- id: ruff
49+
- repo: https://github.com/psf/black
50+
rev: 25.1.0
51+
hooks:
52+
- id: black
53+
- repo: https://github.com/crate-ci/typos
54+
rev: typos-dict-v0.12.4
55+
hooks:
56+
- id: typos
57+
- repo: https://github.com/astral-sh/uv-pre-commit
58+
# uv version.
59+
rev: 0.7.1
60+
hooks:
61+
# Update the uv lockfile
62+
- id: uv-lock
63+
- repo: local
64+
hooks:
65+
- id: dont-commit-upstream
66+
name: NVIDIA-INTERNAL check
67+
entry: "!NVIDIA-INTERNAL"
68+
exclude: "mlir-tensorrt/.pre-commit-config.yaml"
69+
language: pygrep
70+
types: [text]

0 commit comments

Comments
 (0)