Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/microsoft/onnxruntime into …
Browse files Browse the repository at this point in the history
…bugapi
  • Loading branch information
xadupre committed Nov 13, 2023
2 parents 22f69f0 + 4a82030 commit 6d39bf9
Show file tree
Hide file tree
Showing 1,449 changed files with 117,555 additions and 136,770 deletions.
44 changes: 44 additions & 0 deletions .github/actions/rust-toolchain-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json

name: 'Rust toolchain setup'
description: 'Common setup steps for GitHub workflows for Rust projects'

runs:
using: composite
steps:
- uses: dtolnay/rust-toolchain@1.71.0
with:
components: clippy, rustfmt
- uses: extractions/setup-just@v1
with:
just-version: '1.15.0' # optional semver specification, otherwise latest

###
### Linux setup
###
- name: rustup
# We need to use the nightly rust tool change to enable registry-auth / to connect to ADO feeds.
if: ${{ (runner.os == 'Linux') }}
run: |
rustup set profile minimal
rustup install
shell: bash
# - name: Cargo login
# if: ${{ (runner.os == 'Linux') }}
# run: just cargo-login-ci
# shell: bash

###
### Windows setup
###
- name: rustup
# We need to use the nightly rust tool change to enable registry-auth / to connect to ADO feeds.
if: ${{ (runner.os == 'Windows') }}
run: |
rustup set profile minimal
rustup install
shell: pwsh
# - name: Cargo login
# if: ${{ (runner.os == 'Windows') }}
# run: just cargo-login-ci-windows
# shell: pwsh
22 changes: 0 additions & 22 deletions .github/stale.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/cffconvert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out a copy of the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/cffconvert-github-action@2.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Optional Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: misspell # Check spellings as well
uses: reviewdog/action-misspell@v1
with:
Expand All @@ -34,7 +34,7 @@ jobs:
name: Python format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
name: Lint JavaScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: reviewdog/action-eslint@v1
with:
reporter: github-pr-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
Onnxruntime-TVM:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-c-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ jobs:
name: Generate C/C++ API docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install doxygen and dependencies
run: |
sudo apt update
sudo apt-get install libclang-dev
sudo apt-get install libclang-cpp14
wget https://www.doxygen.nl/files/doxygen-1.9.6.linux.bin.tar.gz
tar xvzf doxygen-1.9.6.linux.bin.tar.gz
wget https://www.doxygen.nl/files/doxygen-1.9.8.linux.bin.tar.gz
tar xvzf doxygen-1.9.8.linux.bin.tar.gz
- name: Run doxygen
run: |
mkdir -p build/doxygen
cd docs/c_cxx
../../doxygen-1.9.6/bin/doxygen
../../doxygen-1.9.8/bin/doxygen
- name: Log source commit
run: git rev-parse --short HEAD > build/doxygen/html/source-version.txt
- name: Move C/C++ docs into site
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-csharp-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
env:
DOCFXVERSION: 2.62.2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-java-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: Generate Java docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-js-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: Generate JS API docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-objectivec-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: Generate Objective-C API docs
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Jazzy
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-python-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: Generate Python API docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install tools
run: |
sudo apt-get update
Expand Down
132 changes: 132 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Rust

on: [pull_request]

env:
CARGO_TERM_COLOR: always
RUST_LOG: onnxruntime=debug,onnxruntime-sys=debug
RUST_BACKTRACE: 1
MANIFEST_PATH: ${{ github.workspace }}/rust/Cargo.toml

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
- name: vendor onnxruntime source
run: just vendor
- name: fmt
run: cargo fmt --all -- --check

download:
name: Download prebuilt ONNX Runtime archive from build.rs
runs-on: ubuntu-latest
env:
ORT_RUST_STRATEGY=download
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
- run: rustup target install x86_64-unknown-linux-gnu
- run: rustup target install x86_64-apple-darwin
- run: rustup target install i686-pc-windows-msvc
- run: rustup target install x86_64-pc-windows-msvc
# ******************************************************************
- name: Download prebuilt archive (CPU, x86_64-unknown-linux-gnu)
run: cargo build --target x86_64-unknown-linux-gnu --manifest-path ${{ env.MANIFEST_PATH }}
- name: Verify prebuilt archive downloaded (CPU, x86_64-unknown-linux-gnu)
run: ls -lh target/x86_64-unknown-linux-gnu/debug/build/onnxruntime-sys-*/out/onnxruntime-linux-x64-1.*.tgz
# ******************************************************************
- name: Download prebuilt archive (CPU, x86_64-apple-darwin)
run: cargo build --target x86_64-apple-darwin --manifest-path ${{ env.MANIFEST_PATH }}
- name: Verify prebuilt archive downloaded (CPU, x86_64-apple-darwin)
run: ls -lh target/x86_64-apple-darwin/debug/build/onnxruntime-sys-*/out/onnxruntime-osx-x64-1.*.tgz
# ******************************************************************
- name: Download prebuilt archive (CPU, i686-pc-windows-msvc)
run: cargo build --target i686-pc-windows-msvc --manifest-path ${{ env.MANIFEST_PATH }}
- name: Verify prebuilt archive downloaded (CPU, i686-pc-windows-msvc)
run: ls -lh target/i686-pc-windows-msvc/debug/build/onnxruntime-sys-*/out/onnxruntime-win-x86-1.*.zip
# ******************************************************************
- name: Download prebuilt archive (CPU, x86_64-pc-windows-msvc)
run: cargo build --target x86_64-pc-windows-msvc --manifest-path ${{ env.MANIFEST_PATH }}
- name: Verify prebuilt archive downloaded (CPU, x86_64-pc-windows-msvc)
run: ls -lh target/x86_64-pc-windows-msvc/debug/build/onnxruntime-sys-*/out/onnxruntime-win-x64-1.*.zip
# ******************************************************************
- name: Download prebuilt archive (GPU, x86_64-unknown-linux-gnu)
env:
ORT_USE_CUDA: "yes"
run: cargo build --target x86_64-unknown-linux-gnu --manifest-path ${{ env.MANIFEST_PATH }}
- name: Verify prebuilt archive downloaded (GPU, x86_64-unknown-linux-gnu)
run: ls -lh target/x86_64-unknown-linux-gnu/debug/build/onnxruntime-sys-*/out/onnxruntime-linux-x64-gpu-1.*.tgz
# ******************************************************************
- name: Download prebuilt archive (GPU, x86_64-pc-windows-msvc)
env:
ORT_USE_CUDA: "yes"
run: cargo build --target x86_64-pc-windows-msvc --manifest-path ${{ env.MANIFEST_PATH }}
- name: Verify prebuilt archive downloaded (GPU, x86_64-pc-windows-msvc)
run: ls -lh target/x86_64-pc-windows-msvc/debug/build/onnxruntime-sys-*/out/onnxruntime-win-gpu-x64-1.*.zip

test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
target:
[
x86_64-unknown-linux-gnu,
x86_64-apple-darwin,
x86_64-pc-windows-msvc,
i686-pc-windows-msvc,
]
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: i686-pc-windows-msvc
os: windows-latest
env:
CARGO_BUILD_TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
- name: vendor onnxruntime source
run: just vendor
- run: rustup target install ${{ matrix.target }}
- name: Install additional packages (macOS)
if: contains(matrix.target, 'x86_64-apple-darwin')
run: brew install libomp
- name: Build (cargo build)
run: cargo build --all --manifest-path ${{ env.MANIFEST_PATH }}
- name: Build tests (cargo test)
run: cargo test --no-run --manifest-path ${{ env.MANIFEST_PATH }}
- name: Build onnxruntime with 'model-fetching' feature
run: cargo build --manifest-path ${{ env.MANIFEST_PATH }} --features model-fetching
- name: Test onnxruntime-sys
run: cargo build --package onnxruntime-sys -- --test-threads=1 --nocapture
- name: Test onnxruntime
run: cargo test --manifest-path ${{ env.MANIFEST_PATH }} --features model-fetching -- --test-threads=1 --nocapture

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
- name: vendor onnxruntime source
run: just vendor
- run: clippy --all-features --manifest-path ${{ env.MANIFEST_PATH }} -- -D warnings

package-sys:
name: Package onnxruntime-sys
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
- name: vendor onnxruntime source
run: just vendor
- run: cargo package --allow-dirty --package onnxruntime-sys
Loading

0 comments on commit 6d39bf9

Please sign in to comment.