@@ -4,6 +4,8 @@ on: [pull_request]
44
55env :
66 CARGO_TERM_COLOR : always
7+ RUST_LOG : onnxruntime=debug,onnxruntime-sys=debug
8+ RUST_BACKTRACE : 1
79
810jobs :
911 fmt :
2224 command : fmt
2325 args : --all -- --check
2426
25- test :
26- name : Test
27+ download :
28+ name : Download prebuilt ONNX Runtime archive from build.rs
2729 runs-on : ubuntu-latest
2830 steps :
2931 - uses : actions/checkout@v2
@@ -32,20 +34,131 @@ jobs:
3234 profile : minimal
3335 toolchain : stable
3436 override : true
35- # We want to test using '--features model-fetching', but this is not possible yet.
36- # See https://github.com/actions-rs/cargo/issues/86
37- - uses : actions-rs/cargo@v1
38- name : Test onnxruntime-sys
37+ - run : rustup target install x86_64-unknown-linux-gnu
38+ - run : rustup target install x86_64-apple-darwin
39+ - run : rustup target install i686-pc-windows-msvc
40+ - run : rustup target install x86_64-pc-windows-msvc
41+ # ******************************************************************
42+ - name : Download prebuilt archive (CPU, x86_64-unknown-linux-gnu)
43+ uses : actions-rs/cargo@v1
3944 with :
40- command : test
41- args : --package onnxruntime-sys
42- - uses : actions-rs/cargo@v1
43- name : Test onnxruntime
45+ command : build
46+ args : --target x86_64-unknown-linux-gnu
47+ - name : Verify prebuilt archive downloaded (CPU, x86_64-unknown-linux-gnu)
48+ run : ls -lh target/x86_64-unknown-linux-gnu/debug/build/onnxruntime-sys-*/out/onnxruntime-linux-x64-1.*.tgz
49+ # ******************************************************************
50+ - name : Download prebuilt archive (CPU, x86_64-apple-darwin)
51+ uses : actions-rs/cargo@v1
52+ with :
53+ command : build
54+ args : --target x86_64-apple-darwin
55+ - name : Verify prebuilt archive downloaded (CPU, x86_64-apple-darwin)
56+ run : ls -lh target/x86_64-apple-darwin/debug/build/onnxruntime-sys-*/out/onnxruntime-osx-x64-1.*.tgz
57+ # # ******************************************************************
58+ # - name: Download prebuilt archive (CPU, i686-pc-windows-msvc)
59+ # uses: actions-rs/cargo@v1
60+ # with:
61+ # command: build
62+ # args: --target i686-pc-windows-msvc
63+ # - name: Verify prebuilt archive downloaded (CPU, i686-pc-windows-msvc)
64+ # run: ls -lh target/i686-pc-windows-msvc/debug/build/onnxruntime-sys-*/out/onnxruntime-win-x86-1.*.zip
65+ # ******************************************************************
66+ - name : Download prebuilt archive (CPU, x86_64-pc-windows-msvc)
67+ uses : actions-rs/cargo@v1
68+ with :
69+ command : build
70+ args : --target x86_64-pc-windows-msvc
71+ - name : Verify prebuilt archive downloaded (CPU, x86_64-pc-windows-msvc)
72+ run : ls -lh target/x86_64-pc-windows-msvc/debug/build/onnxruntime-sys-*/out/onnxruntime-win-x64-1.*.zip
73+ # ******************************************************************
74+ - name : Download prebuilt archive (GPU, x86_64-unknown-linux-gnu)
75+ uses : actions-rs/cargo@v1
76+ env :
77+ ORT_USE_CUDA : " yes"
78+ with :
79+ command : build
80+ args : --target x86_64-unknown-linux-gnu
81+ - name : Verify prebuilt archive downloaded (GPU, x86_64-unknown-linux-gnu)
82+ run : ls -lh target/x86_64-unknown-linux-gnu/debug/build/onnxruntime-sys-*/out/onnxruntime-linux-x64-gpu-1.*.tgz
83+ # ******************************************************************
84+ - name : Download prebuilt archive (GPU, x86_64-pc-windows-msvc)
85+ uses : actions-rs/cargo@v1
4486 env :
45- RUST_LOG : onnxruntime=debug
87+ ORT_USE_CUDA : " yes"
88+ with :
89+ command : build
90+ args : --target x86_64-pc-windows-msvc
91+ - name : Verify prebuilt archive downloaded (GPU, x86_64-pc-windows-msvc)
92+ run : ls -lh target/x86_64-pc-windows-msvc/debug/build/onnxruntime-sys-*/out/onnxruntime-win-x64-gpu-1.*.zip
93+
94+ test :
95+ name : Test Suite
96+ runs-on : ${{ matrix.os }}
97+ strategy :
98+ fail-fast : false
99+ matrix :
100+ build :
101+ - linux-gnu
102+ - macos
103+ - win-msvc
104+ include :
105+ - build : linux-gnu
106+ os : ubuntu-latest
107+ rust : stable
108+ target : x86_64-unknown-linux-gnu
109+ - build : macos
110+ os : macOS-latest
111+ rust : stable
112+ target : x86_64-apple-darwin
113+ # FIXME: Re-enable CI for Windows: https://github.com/nbigaouette/onnxruntime-rs/issues/43
114+ # - build: win-msvc
115+ # os: windows-2019
116+ # rust: stable
117+ # target: x86_64-pc-windows-msvc
118+ # - build: win-msvc
119+ # os: windows-2019
120+ # rust: stable
121+ # target: i686-pc-windows-msvc
122+ env :
123+ CARGO_BUILD_TARGET : ${{ matrix.target }}
124+ steps :
125+ - uses : actions/checkout@v2
126+ - name : Install Rust
127+ uses : actions-rs/toolchain@v1
128+ with :
129+ profile : minimal
130+ toolchain : ${{ matrix.rust }}
131+ target : ${{ matrix.target }}
132+ override : true
133+ - name : Install additional packages (macOS)
134+ if : contains(matrix.target, 'x86_64-apple-darwin')
135+ run : brew install libomp
136+ - name : Build (cargo build)
137+ uses : actions-rs/cargo@v1
138+ with :
139+ command : build
140+ args : --all
141+ - name : Build tests (cargo test)
142+ uses : actions-rs/cargo@v1
46143 with :
144+ command : test
145+ args : --no-run
146+ - name : Build onnxruntime with 'model-fetching' feature
147+ uses : actions-rs/cargo@v1
148+ with :
149+ command : build
47150 # Use --manifest-path instead of --package. See https://github.com/actions-rs/cargo/issues/86
151+ args : --manifest-path onnxruntime/Cargo.toml --features model-fetching
152+ - name : Test onnxruntime-sys
153+ uses : actions-rs/cargo@v1
154+ with :
48155 command : test
156+ args : --package onnxruntime-sys -- --test-threads=1 --nocapture
157+ - name : Test onnxruntime
158+ uses : actions-rs/cargo@v1
159+ with :
160+ command : test
161+ # Use --manifest-path instead of --package. See https://github.com/actions-rs/cargo/issues/86
49162 args : --manifest-path onnxruntime/Cargo.toml --features model-fetching -- --test-threads=1 --nocapture
50163
51164 clippy :
0 commit comments