|
10 | 10 | # Allows you to run this workflow manually from the Actions tab |
11 | 11 | workflow_dispatch: |
12 | 12 |
|
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
13 | 17 | jobs: |
14 | 18 | test: |
15 | 19 | strategy: |
16 | 20 | fail-fast: false |
17 | 21 | matrix: |
18 | 22 | os: [ubuntu-latest, windows-latest, macos-latest] |
19 | 23 | name: |
20 | | - # - python311-onnx |
21 | | - # TODO: Enable python311 when onnx is updated |
22 | | - - python310-onnx |
23 | | - - python39-onnx |
24 | | - - python39-expe |
25 | | - - python38-expe |
| 24 | + # names should match tox labels in tox.ini |
| 25 | + - python310 |
| 26 | + - python39 |
| 27 | + - python38 |
| 28 | + - python310-experimental |
| 29 | + - python310-torch-nightly |
26 | 30 | include: |
27 | | - # - name: python311-onnx |
28 | | - # python-version: "3.11" |
29 | | - # onnx_standard: true |
30 | | - # test_examples: true |
31 | | - - name: python310-onnx |
| 31 | + - name: python310 |
32 | 32 | python-version: "3.10" |
33 | | - onnx_standard: true |
34 | | - test_examples: true |
35 | | - - name: python39-onnx |
36 | | - python-version: "3.9" |
37 | | - onnx_standard: true |
38 | | - test_examples: false |
39 | | - - name: python39-expe |
| 33 | + - name: python39 |
40 | 34 | python-version: "3.9" |
41 | | - onnx_standard: false |
42 | | - test_examples: false |
43 | | - - name: python38-expe |
| 35 | + - name: python38 |
44 | 36 | python-version: "3.8" |
45 | | - onnx_standard: false |
46 | | - test_examples: false |
| 37 | + - name: python310-experimental |
| 38 | + python-version: "3.10" |
| 39 | + - name: python310-torch-nightly |
| 40 | + python-version: "3.10" |
47 | 41 | runs-on: ${{ matrix.os }} |
48 | 42 | steps: |
49 | 43 | - uses: actions/checkout@v3 |
50 | 44 | - name: Setup Python ${{ matrix.python-version }} |
51 | 45 | uses: actions/setup-python@v4 |
52 | 46 | with: |
53 | 47 | python-version: ${{ matrix.python-version }} |
54 | | - cache: pip |
55 | | - cache-dependency-path: "**/requirements-dev.txt" |
56 | | - - name: Install dependencies |
57 | | - run: | |
58 | | - python -m pip install --upgrade pip setuptools wheel build |
59 | | - python -m pip install -r requirements-dev.txt |
60 | | -
|
61 | | - - name: Install standard onnx |
62 | | - if: ${{ matrix.onnx_standard }} |
63 | | - run: | |
64 | | - python -m pip uninstall -y onnx-function-experiment |
65 | | - python -m pip uninstall -y ort-function-experiment-nightly |
66 | | - python -m pip install -r requirements-onnx.txt |
67 | | -
|
68 | | - - name: Versions |
69 | | - run: | |
70 | | - pip list | grep numpy |
71 | | - pip list | grep onnx |
72 | | - pip list | grep torch |
73 | | -
|
74 | | - - name: pytest |
75 | | - run: pytest -v onnxscript --cov=onnxscript --cov-report=xml -n=auto |
76 | | - |
77 | | - - name: Install package |
78 | | - run: pip install . |
79 | | - |
80 | | - - name: Test examples |
81 | | - if: ${{ matrix.test_examples }} |
82 | | - run: pytest -v docs/test -n=auto |
83 | | - |
84 | | - - name: Build package |
85 | | - run: python -m build |
86 | | - |
| 48 | + - name: Install tox |
| 49 | + run: python -m pip install tox tox-gh |
| 50 | + - name: Setup test suite |
| 51 | + run: tox -m ${{ matrix.name }} --colored yes -vv --notest |
| 52 | + - name: Run test suite |
| 53 | + run: tox -m ${{ matrix.name }} --colored yes --skip-pkg-install -- -v --cov=onnxscript --cov-report=xml -n=auto |
87 | 54 | - name: Upload coverage to Codecov |
88 | 55 | uses: codecov/codecov-action@v3 |
89 | 56 |
|
|
0 commit comments