|
4 | 4 | branches:
|
5 | 5 | - main
|
6 | 6 | push:
|
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + code_coverage: |
| 10 | + description: if enabled, code coverage metrics will be collected during the test run |
| 11 | + type: boolean |
| 12 | + default: false |
7 | 13 |
|
8 | 14 | env:
|
9 | 15 | CADENCE: "commit"
|
|
36 | 42 | BUILD_TYPE=nightly pip3 install .
|
37 | 43 | - name: "Clean compressed-tensors directory"
|
38 | 44 | run: rm -r compressed-tensors/
|
| 45 | + - name: "⚙️ Prepare code coverage" |
| 46 | + if: inputs.code_coverage |
| 47 | + uses: ./.github/actions/prepare-code-coverage |
39 | 48 | - name: "🔬 Running base tests"
|
40 | 49 | run: make test
|
| 50 | + - name: "Upload coverage report" |
| 51 | + if: (success() || failure()) && inputs.code_coverage |
| 52 | + uses: actions/upload-artifact@v4 |
| 53 | + with: |
| 54 | + name: base-tests-coverage-results |
| 55 | + path: | |
| 56 | + .coverage |
| 57 | + coverage-html |
| 58 | + coverage.json |
| 59 | + retention-days: 5 |
41 | 60 |
|
42 | 61 | pytorch-tests:
|
43 | 62 | runs-on: ubuntu-22.04
|
|
65 | 84 | BUILD_TYPE=nightly pip3 install .
|
66 | 85 | - name: "Clean compressed-tensors directory"
|
67 | 86 | run: rm -r compressed-tensors/
|
| 87 | + - name: "⚙️ Prepare code coverage" |
| 88 | + if: inputs.code_coverage |
| 89 | + uses: ./.github/actions/prepare-code-coverage |
68 | 90 | - name: "🔬 Running pytorch tests"
|
69 | 91 | run: |
|
70 | 92 | pytest -v tests/llmcompressor/pytorch
|
| 93 | + - name: "Upload coverage report" |
| 94 | + if: (success() || failure()) && inputs.code_coverage |
| 95 | + uses: actions/upload-artifact@v4 |
| 96 | + with: |
| 97 | + name: pytorch-tests-coverage-results |
| 98 | + path: | |
| 99 | + .coverage |
| 100 | + coverage-html |
| 101 | + coverage.json |
| 102 | + retention-days: 5 |
| 103 | + |
71 | 104 |
|
72 | 105 | compat-pytorch-1_9-pytorch-tests:
|
73 | 106 | runs-on: ubuntu-22.04
|
@@ -95,6 +128,19 @@ jobs:
|
95 | 128 | BUILD_TYPE=nightly pip3 install .
|
96 | 129 | - name: "Clean compressed-tensors directory"
|
97 | 130 | run: rm -r compressed-tensors/
|
| 131 | + - name: "⚙️ Prepare code coverage" |
| 132 | + if: inputs.code_coverage |
| 133 | + uses: ./.github/actions/prepare-code-coverage |
98 | 134 | - name: "🔬 Running pytorch tests"
|
99 | 135 | run: |
|
100 | 136 | pytest -v tests/llmcompressor/pytorch
|
| 137 | + - name: "Upload coverage report" |
| 138 | + if: (success() || failure()) && inputs.code_coverage |
| 139 | + uses: actions/upload-artifact@v4 |
| 140 | + with: |
| 141 | + name: compat-pytorch-tests-coverage-results |
| 142 | + path: | |
| 143 | + .coverage |
| 144 | + coverage-html |
| 145 | + coverage.json |
| 146 | + retention-days: 5 |
0 commit comments