-
Notifications
You must be signed in to change notification settings - Fork 53
162 lines (155 loc) · 4.89 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
on:
schedule:
# Run weekly on Mondays and Wednesdays 00:00
- cron: '00 00 * * MON,WED'
push:
branches:
- main
- 'gh/**/base' # ghstack base branches
- rel-*
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
name:
- py312-torch-nightly
- py311
- py311-torch-nightly
- py311-onnx-weekly
- py311-ort-nightly
- py311-experimental-torchlib-tracing
- py310
- py39
include:
- name: py311
python-version: "3.11"
nox-tag: test build
- name: py310
python-version: "3.10"
nox-tag: test
- name: py39
python-version: "3.9"
nox-tag: test
- name: py312-torch-nightly
python-version: "3.12"
nox-tag: test-torch-nightly
- name: py311-torch-nightly
python-version: "3.11"
nox-tag: test-torch-nightly
- name: py311-onnx-weekly
python-version: "3.11"
nox-tag: test-onnx-weekly
- name: py311-ort-nightly
python-version: "3.11"
nox-tag: test-ort-nightly
- name: py311-experimental-torchlib-tracing
python-version: "3.11"
nox-tag: test-experimental-torchlib-tracing
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install nox
run: python -m pip install nox
- name: Pull Test Data
run: git lfs pull
- name: Run tests
run: nox -t ${{ matrix.nox-tag }} --forcecolor -- --cov=onnxscript --cov-report=xml --cov-append --cov-branch -n=auto --junitxml junit.xml
env:
CATCH_ORT_SEGFAULT: "${{ matrix.os == 'ubuntu-latest' && '1' || '0' }}"
CREATE_REPRODUCTION_REPORT: "${{ matrix.os == 'ubuntu-latest' && '1' || '0' }}"
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload torchlib error reports
if: always()
uses: actions/upload-artifact@v3
with:
name: Error reports (${{ matrix.name }}-${{ matrix.os }})
path: error_reports
dort:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
transformers: ["4.37.2", "4.41.2", "4.42.3"]
torch: ["release", "nightly"]
python_version: ["3.11"]
nox-tag: ["test-dort"]
name:
- dort
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install nox
run: python -m pip install nox
- name: Pull Test Data
run: git lfs pull
- run: |
nox -t ${{ matrix.nox-tag }} --forcecolor -- ${{ matrix.torch }} ${{ matrix.transformers }}
name: Run tests
build_docs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: "**/requirements-dev.txt"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-dev.txt
- name: Versions
run: |
pip list | grep numpy
pip list | grep onnx
pip list | grep torch
- name: Install package
run: pip install .
- name: Build documentation
run: python -m sphinx docs dist/html
update_readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Update readme
run: |
python docs/update_readme.py
git diff --exit-code -- 'README.md'
if [ $? -ne 0 ]; then
echo "Update readme by running `python docs/update_readme.py`"
exit 1
fi