-
Notifications
You must be signed in to change notification settings - Fork 55
55 lines (45 loc) · 1.67 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
name: "Cargo Tests"
on:
pull_request:
schedule:
- cron: 0 0 * * *
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
ONNX_VERSION: v1.20.1
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore Builds
id: cache-build-restore
uses: actions/cache/restore@v4
with:
key: '${{ runner.os }}-onnxruntime-${{ env.ONNX_VERSION }}'
path: |
onnxruntime/build/Linux/Release/
- name: Compile ONNX Runtime for Linux
if: steps.cache-build-restore.outputs.cache-hit != 'true'
run: |
echo Cloning ONNX Runtime repository...
git clone https://github.com/microsoft/onnxruntime --recursive --branch $ONNX_VERSION --single-branch --depth 1
cd onnxruntime
./build.sh --update --build --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync
cd ..
- name: Cargo Test With Release Build
run: ORT_LIB_LOCATION="$(pwd)/onnxruntime/build/Linux/Release" cargo test --release --no-default-features --features online
- name: Cargo Test Offline
run: ORT_LIB_LOCATION="$(pwd)/onnxruntime/build/Linux/Release" cargo test --no-default-features
- name: Cargo Clippy
run: cargo clippy
- name: Cargo FMT
run: cargo fmt --all -- --check
- name: Always Save Cache
id: cache-build-save
if: always() && steps.cache-build-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: '${{ steps.cache-build-restore.outputs.cache-primary-key }}'
path: |
onnxruntime/build/Linux/Release/