Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding rust-ci.yml #18305

Closed
wants to merge 13 commits into from
Closed
4 changes: 2 additions & 2 deletions .github/actions/rust-toolchain-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
if: ${{ (runner.os == 'Linux') }}
run: |
rustup set profile minimal
rustup install
rustup toolchain install nightly
shell: bash
# - name: Cargo login
# if: ${{ (runner.os == 'Linux') }}
Expand All @@ -36,7 +36,7 @@ runs:
if: ${{ (runner.os == 'Windows') }}
run: |
rustup set profile minimal
rustup install
rustup toolchain install nightly
shell: pwsh
# - name: Cargo login
# if: ${{ (runner.os == 'Windows') }}
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ env:
RUST_LOG: onnxruntime=debug,onnxruntime-sys=debug
RUST_BACKTRACE: 1
MANIFEST_PATH: ${{ github.workspace }}/rust/Cargo.toml

ORT_SYS_MANIFEST_PATH: ${{ github.workspace }}/rust/onnxruntime-sys/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
# remove this step when we need a justfile
# - name: vendor onnxruntime source
# run: just vendor
- name: fmt
run: cargo fmt --all -- --check
run: cargo fmt --all --manifest-path ${{ env.MANIFEST_PATH }} -- --check

download:
name: Download prebuilt ONNX Runtime archive from build.rs
runs-on: ubuntu-latest
env:
ORT_RUST_STRATEGY=download
ORT_RUST_STRATEGY: download
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
Expand Down Expand Up @@ -94,8 +95,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
- name: vendor onnxruntime source
run: just vendor
# - 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')
Expand All @@ -117,8 +118,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain-setup
- name: vendor onnxruntime source
run: just vendor
- run: rustup component add clippy
# - name: vendor onnxruntime source
# run: just vendor
- run: clippy --all-features --manifest-path ${{ env.MANIFEST_PATH }} -- -D warnings

package-sys:
Expand All @@ -127,6 +129,6 @@ jobs:
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
# - name: vendor onnxruntime source
# run: just vendor
- run: cargo package --allow-dirty --package onnxruntime-sys --manifest-path ${{ env.ORT_SYS_MANIFEST_PATH }}
1 change: 1 addition & 0 deletions rust/onnxruntime-sys/VERSION_NUMBER
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.16.0
2 changes: 1 addition & 1 deletion rust/onnxruntime-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use anyhow::{anyhow, Context, Result};
/// WARNING: If version is changed, bindings for all platforms will have to be re-generated.
/// To do so, run this:
/// cargo build --package onnxruntime-sys --features generate-bindings
const ORT_VERSION: &str = include_str!("./vendor/onnxruntime-src/VERSION_NUMBER");
const ORT_VERSION: &str = include_str!("./VERSION_NUMBER");

/// Base Url from which to download pre-built releases/
const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/releases/download";
Expand Down
Loading