@@ -2,84 +2,113 @@ name: Tests
2
2
3
3
on :
4
4
push :
5
- branches : [ main, develop, findhao/setup_ci ]
5
+ branches : [main, develop, findhao/setup_ci]
6
6
pull_request :
7
- branches : [ main ]
7
+ branches : [main]
8
8
workflow_dispatch :
9
9
inputs :
10
10
test-type :
11
- description : ' Type of tests to run'
11
+ description : " Type of tests to run"
12
12
required : true
13
- default : ' all'
13
+ default : " all"
14
14
type : choice
15
15
options :
16
- - ' all'
17
- - ' cpu'
18
- - ' cuda'
16
+ - " all"
17
+ - " cpu"
18
+ - " cuda"
19
19
coverage :
20
- description : ' Enable coverage reporting'
20
+ description : " Enable coverage reporting"
21
21
required : true
22
22
default : false
23
23
type : boolean
24
24
25
25
jobs :
26
26
test :
27
27
runs-on : 4-core-ubuntu-gpu-t4
28
+ timeout-minutes : 120
28
29
steps :
29
- - uses : actions/checkout@v4
30
-
31
- - name : Set up Python 3.11
32
- uses : actions/setup-python@v4
33
- with :
34
- python-version : " 3.11"
35
-
36
- - name : Install CUDA 12.6
37
- run : |
38
- sudo apt-get update
39
- sudo apt-get install -y cuda-toolkit-12.6
40
-
41
- - name : Setup environment
42
- env :
43
- CONDA_ENV : tritonparse
44
- PYTHON_VERSION : " 3.11"
45
- CUDA_VERSION : " 12.6"
46
- run : |
47
- bash .ci/setup.sh
48
-
49
- - name : Install Triton from source
50
- env :
51
- CONDA_ENV : tritonparse
52
- run : |
53
- bash .ci/install-triton.sh
54
-
55
- - name : Install project dependencies
56
- env :
57
- CONDA_ENV : tritonparse
58
- run : |
59
- bash .ci/install-project.sh
60
-
61
- - name : Cache pip dependencies
62
- uses : actions/cache@v3
63
- with :
64
- path : ~/.cache/pip
65
- key : ${{ runner.os }}-pip-3.11-${{ hashFiles('**/pyproject.toml') }}
66
- restore-keys : |
67
- ${{ runner.os }}-pip-3.11-
68
-
69
- - name : Run tests
70
- env :
71
- CONDA_ENV : tritonparse
72
- TEST_TYPE : ${{ github.event.inputs.test-type || 'all' }}
73
- COVERAGE : ${{ github.event.inputs.coverage || 'false' }}
74
- run : |
75
- bash .ci/run-tests.sh
76
-
77
- - name : Upload coverage to Codecov
78
- if : ${{ github.event.inputs.coverage == 'true' }}
79
- uses : codecov/codecov-action@v3
80
- with :
81
- file : ./coverage.xml
82
- flags : unittests
83
- name : codecov-umbrella
84
- fail_ci_if_error : false
30
+ - uses : actions/checkout@v4
85
31
32
+ - name : Set up Python 3.11
33
+ uses : actions/setup-python@v4
34
+ with :
35
+ python-version : " 3.11"
36
+
37
+ - name : Install CUDA 12.8
38
+ run : |
39
+ sudo apt-get update
40
+ sudo apt-get install -y cuda-toolkit-12.8
41
+
42
+ - name : Setup environment
43
+ env :
44
+ CONDA_ENV : tritonparse
45
+ PYTHON_VERSION : " 3.11"
46
+ CUDA_VERSION : " 12.8"
47
+ run : |
48
+ bash .ci/setup.sh
49
+
50
+ - name : Install Triton from source
51
+ env :
52
+ CONDA_ENV : tritonparse
53
+ run : |
54
+ bash .ci/install-triton.sh
55
+
56
+ - name : Install project dependencies
57
+ env :
58
+ CONDA_ENV : tritonparse
59
+ run : |
60
+ bash .ci/install-project.sh
61
+
62
+ - name : Cache pip dependencies
63
+ uses : actions/cache@v3
64
+ with :
65
+ path : ~/.cache/pip
66
+ key : ${{ runner.os }}-pip-3.11-${{ hashFiles('**/pyproject.toml') }}
67
+ restore-keys : |
68
+ ${{ runner.os }}-pip-3.11-
69
+
70
+ - name : Run tests
71
+ env :
72
+ CONDA_ENV : tritonparse
73
+ TEST_TYPE : ${{ github.event.inputs.test-type || 'all' }}
74
+ COVERAGE : ${{ github.event.inputs.coverage || 'false' }}
75
+ run : |
76
+ bash .ci/run-tests.sh
77
+
78
+ lint :
79
+ runs-on : ubuntu-latest
80
+ steps :
81
+ - uses : actions/checkout@v4
82
+
83
+ - name : Set up Python 3.11
84
+ uses : actions/setup-python@v4
85
+ with :
86
+ python-version : " 3.11"
87
+
88
+ - name : Install linting dependencies
89
+ run : |
90
+ python -m pip install --upgrade pip
91
+ pip install ruff black isort mypy
92
+
93
+ - name : Install project dependencies
94
+ run : |
95
+ pip install -e ".[test]"
96
+
97
+ - name : Run ruff (linter)
98
+ run : |
99
+ ruff check tritonparse/
100
+ ruff check tests/
101
+
102
+ - name : Run black (code formatter)
103
+ run : |
104
+ black --check tritonparse/
105
+ black --check tests/
106
+
107
+ - name : Run isort (import sorter)
108
+ run : |
109
+ isort --check-only tritonparse/
110
+ isort --check-only tests/
111
+
112
+ - name : Run mypy (type checker)
113
+ run : |
114
+ mypy tritonparse/ --ignore-missing-imports
0 commit comments