-
Notifications
You must be signed in to change notification settings - Fork 100
101 lines (92 loc) · 2.85 KB
/
ci.yml
File metadata and controls
101 lines (92 loc) · 2.85 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
# Point ort-sys to the system-installed ONNX Runtime so it never tries to
# reach cdn.pyke.io (which is not available on GitHub-hosted runners).
ORT_LIB_LOCATION: /opt/onnxruntime/lib
ORT_PREFER_DYNAMIC_LINK: "1"
jobs:
setup-onnxruntime:
name: Cache ONNX Runtime
runs-on: ubuntu-latest
steps:
- name: Cache ONNX Runtime
id: cache-ort
uses: actions/cache@v4
with:
path: /opt/onnxruntime
key: onnxruntime-1.23.2-linux-x64
- name: Download ONNX Runtime 1.23.2
if: steps.cache-ort.outputs.cache-hit != 'true'
run: |
curl -L "https://github.com/microsoft/onnxruntime/releases/download/v1.23.2/onnxruntime-linux-x64-1.23.2.tgz" \
-o /tmp/onnxruntime.tgz
mkdir -p /opt/onnxruntime
tar -xzf /tmp/onnxruntime.tgz --strip-components=1 -C /opt/onnxruntime
check:
name: Check
runs-on: ubuntu-latest
needs: setup-onnxruntime
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Restore ONNX Runtime
uses: actions/cache@v4
with:
path: /opt/onnxruntime
key: onnxruntime-1.23.2-linux-x64
- run: echo "/opt/onnxruntime/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf && sudo ldconfig
- run: cargo check
test:
name: Test
runs-on: ubuntu-latest
needs: setup-onnxruntime
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Restore ONNX Runtime
uses: actions/cache@v4
with:
path: /opt/onnxruntime
key: onnxruntime-1.23.2-linux-x64
- run: echo "/opt/onnxruntime/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf && sudo ldconfig
- run: cargo test
clippy:
name: Clippy
runs-on: ubuntu-latest
needs: setup-onnxruntime
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Restore ONNX Runtime
uses: actions/cache@v4
with:
path: /opt/onnxruntime
key: onnxruntime-1.23.2-linux-x64
- run: echo "/opt/onnxruntime/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf && sudo ldconfig
- run: cargo clippy -- -D warnings
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
license:
name: License audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2