-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (50 loc) · 1.95 KB
/
test.yml
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
name: test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
rust-toolchain:
- nightly
runs-on: ${{ matrix.os }}
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
- name: Setup ${{ matrix.rust-toolchain }} rust toolchain with caching
uses: brndnmtthws/rust-action@v1
with:
toolchain: ${{ matrix.rust-toolchain }}
- name: Install ONNX Runtime on Windows
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri "https://github.com/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-win-x64-1.17.1.zip" -OutFile "onnxruntime.zip"
Expand-Archive -Path "onnxruntime.zip" -DestinationPath "$env:RUNNER_TEMP"
echo "ONNXRUNTIME_DIR=$env:RUNNER_TEMP\onnxruntime-win-x64-1.17.1" | Out-File -Append -Encoding ascii $env:GITHUB_ENV
- name: Install ONNX Runtime on macOS
if: matrix.os == 'macos-latest'
run: |
curl -L "https://github.com/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-osx-x86_64-1.17.1.tgz" -o "onnxruntime.tgz"
mkdir -p $HOME/onnxruntime
tar -xzf onnxruntime.tgz -C $HOME/onnxruntime
echo "ONNXRUNTIME_DIR=$HOME/onnxruntime/onnxruntime-osx-x86_64-1.17.1" >> $GITHUB_ENV
- name: Set ONNX Runtime library path for macOS
if: matrix.os == 'macos-latest'
run: echo "ORT_DYLIB_PATH=$ONNXRUNTIME_DIR/libonnxruntime.dylib" >> $GITHUB_ENV
- name: Set ONNX Runtime library path for Windows
if: matrix.os == 'windows-latest'
run: echo "ORT_DYLIB_PATH=$ONNXRUNTIME_DIR/onnxruntime.dll" >> $GITHUB_ENV
- name: lint
run: cargo clippy -- -Dwarnings
- name: build
run: cargo build --features "ort/load-dynamic"
env:
ORT_DYLIB_PATH: ${{ env.ORT_DYLIB_PATH }}