Add deduplication pass for initializer tensors (#66) #207
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@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=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/test-results-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
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.12" | |
cache: pip | |
cache-dependency-path: "**/requirements-dev.txt" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
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 | |
build: | |
name: Build | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Python build dependencies | |
run: | | |
python -m pip install --upgrade pip build wheel | |
- name: Build wheels | |
run: | | |
python -m build | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
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@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
attestations: true |