-
Notifications
You must be signed in to change notification settings - Fork 21
146 lines (138 loc) · 3.96 KB
/
main.yml
File metadata and controls
146 lines (138 loc) · 3.96 KB
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
name: CI
permissions:
contents: read
on:
schedule:
# Run weekly on Mondays 00:00
- cron: '00 00 * * MON'
push:
branches:
- main
- 'gh/**/base' # ghstack base branches
tags:
- v*
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:
- py313
- py312-onnx-weekly
- py310
include:
# Test the max and min supported versions of Python
- name: py313
python-version: "3.13"
nox-tag: test build
- name: py312-onnx-weekly
python-version: "3.12"
nox-tag: test-onnx-weekly
- name: py310
python-version: "3.10"
nox-tag: test
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install nox
run: uv pip install --system nox
- name: Pull Test Data
run: git lfs pull
- name: Run tests
env:
NOX_DEFAULT_VENV_BACKEND: uv
run: nox -t ${{ matrix.nox-tag }} --forcecolor -- --cov=src/onnx_ir --cov-report=xml --cov-append --cov-branch -n=auto --junitxml junit.xml
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
report-type: test_results
build_docs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
uv pip install --system -r requirements-dev.txt
- name: Versions
run: |
uv pip list | grep numpy
uv pip list | grep onnx
uv pip list | grep torch
- name: Install package
run: uv pip install --system .
- name: Build documentation
run: python -m sphinx docs dist/html
build:
name: Build
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install Python build dependencies
run: |
uv pip install --system build wheel
- name: Build wheels
run: |
python -m build
- name: Upload wheels
uses: actions/upload-artifact@v7.0.0
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
name: dist
path: dist
release:
name: Release
environment: release
runs-on: ubuntu-latest
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [test, build]
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true