Skip to content

Commit 9a83c00

Browse files
Enable cpu unit tests in Github CI
1 parent 11b3eb6 commit 9a83c00

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

.github/workflows/code_quality.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
name: Code Quality
22

33
on:
4-
push:
5-
tags: ["[0-9]+.[0-9]+.[0-9]+"]
64
pull_request:
75
branches: [main, release/*]
86

7+
# Cancel previous runs if new commit is pushed to the same PR
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
10+
cancel-in-progress: true
11+
912
jobs:
1013
code-quality:
1114
runs-on: ubuntu-latest
@@ -15,7 +18,5 @@ jobs:
1518
- uses: actions/setup-python@v5
1619
with:
1720
python-version: "3.12"
18-
- name: Install tox
19-
run: pip install tox
2021
- name: Run code quality checks
21-
run: tox -e pre-commit-all
22+
run: pip install tox && tox -e pre-commit-all

.github/workflows/unit_tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit tests
2+
3+
on:
4+
pull_request:
5+
branches: [main, release/*]
6+
paths:
7+
- ".github/workflows/unit_tests.yml"
8+
- "modelopt/**"
9+
- "tests/**"
10+
- "setup.py"
11+
- "tox.ini"
12+
13+
# Cancel previous runs if new commit is pushed to the same PR
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
unit-tests:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 30
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.12"
27+
# Build onnxsim from sdists for Python 3.12 until http://github.com/daquexian/onnx-simplifier/pull/353
28+
- name: Install dependencies
29+
run: |
30+
pip install onnxsim
31+
pip install tox
32+
- name: Run unit tests
33+
run: tox -e py312-torch27-unit

0 commit comments

Comments
 (0)