-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,591 changed files
with
139,582 additions
and
151,081 deletions.
There are no files selected for viewing
This file contains 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
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/[email protected] | ||
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 |
This file was deleted.
Oops, something went wrong.
This file contains 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
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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Close stale issues | ||
on: | ||
# Allows you to dictate when you want this workflow to run using cron syntax (times in UTC) | ||
schedule: | ||
- cron: "0 15 * * *" | ||
# Allows you to run this workflow manually from the Actions tab | ||
# workflow_dispatch: | ||
|
||
jobs: | ||
close-stale-issues: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
# Comma separated list of labels that can be assigned to issues to exclude them from being marked as stale | ||
exempt-issue-labels: contributions welcome, feature request, regression | ||
# Override exempt-all-assignees but only to exempt the issues with an assignee to be marked as stale automatically | ||
exempt-all-issue-assignees: true | ||
# Used to ignore the issues and pull requests created before the start date | ||
# Start date should be April 19, 2022 - corresponds to the day previous stale bot stopped working | ||
start-date: '2022-04-19T00:00:00Z' | ||
# Number of days without activity before the actions/stale action labels an issue | ||
days-before-issue-stale: 30 | ||
# Number of days without activity before the actions/stale action closes an issue | ||
days-before-issue-close: 30 | ||
# Label you want to apply to issues that have been inactive for the amount of time specified by days-before-issue-stale | ||
stale-issue-label: "stale" | ||
# Comment that you want to add to issues that are labeled by the actions/stale action | ||
stale-issue-message: "This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details." | ||
# Comment that you want to add to issues that are closed by the actions/stale action | ||
close-issue-message: "This issue has been automatically closed due to inactivity. Please reactivate if further support is needed." | ||
# If you never want this action to label PRs, set this value to -1 | ||
days-before-pr-stale: -1 | ||
# If you never want this action to close PRs, set this value to -1 | ||
days-before-pr-close: -1 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
This file contains 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
Oops, something went wrong.