Skip to content

Commit 33406fd

Browse files
Copilotyiwang
andcommitted
ci: install ONNX Runtime from GitHub releases to bypass cdn.pyke.io block
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
1 parent f9a3d17 commit 33406fd

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,79 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR: always
11+
# Point ort-sys to the system-installed ONNX Runtime so it never tries to
12+
# reach cdn.pyke.io (which is not available on GitHub-hosted runners).
13+
ORT_LIB_LOCATION: /opt/onnxruntime/lib
14+
ORT_PREFER_DYNAMIC_LINK: "1"
1115

1216
jobs:
17+
setup-onnxruntime:
18+
name: Cache ONNX Runtime
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Cache ONNX Runtime
22+
id: cache-ort
23+
uses: actions/cache@v4
24+
with:
25+
path: /opt/onnxruntime
26+
key: onnxruntime-1.23.2-linux-x64
27+
28+
- name: Download ONNX Runtime 1.23.2
29+
if: steps.cache-ort.outputs.cache-hit != 'true'
30+
run: |
31+
curl -L "https://github.com/microsoft/onnxruntime/releases/download/v1.23.2/onnxruntime-linux-x64-1.23.2.tgz" \
32+
-o /tmp/onnxruntime.tgz
33+
mkdir -p /opt/onnxruntime
34+
tar -xzf /tmp/onnxruntime.tgz --strip-components=1 -C /opt/onnxruntime
35+
1336
check:
1437
name: Check
1538
runs-on: ubuntu-latest
39+
needs: setup-onnxruntime
1640
steps:
1741
- uses: actions/checkout@v4
1842
- uses: dtolnay/rust-toolchain@stable
1943
- uses: Swatinem/rust-cache@v2
44+
- name: Restore ONNX Runtime
45+
uses: actions/cache@v4
46+
with:
47+
path: /opt/onnxruntime
48+
key: onnxruntime-1.23.2-linux-x64
49+
- run: echo "/opt/onnxruntime/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf && sudo ldconfig
2050
- run: cargo check
2151

2252
test:
2353
name: Test
2454
runs-on: ubuntu-latest
55+
needs: setup-onnxruntime
2556
steps:
2657
- uses: actions/checkout@v4
2758
- uses: dtolnay/rust-toolchain@stable
2859
- uses: Swatinem/rust-cache@v2
60+
- name: Restore ONNX Runtime
61+
uses: actions/cache@v4
62+
with:
63+
path: /opt/onnxruntime
64+
key: onnxruntime-1.23.2-linux-x64
65+
- run: echo "/opt/onnxruntime/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf && sudo ldconfig
2966
- run: cargo test
3067

3168
clippy:
3269
name: Clippy
3370
runs-on: ubuntu-latest
71+
needs: setup-onnxruntime
3472
steps:
3573
- uses: actions/checkout@v4
3674
- uses: dtolnay/rust-toolchain@stable
3775
with:
3876
components: clippy
3977
- uses: Swatinem/rust-cache@v2
78+
- name: Restore ONNX Runtime
79+
uses: actions/cache@v4
80+
with:
81+
path: /opt/onnxruntime
82+
key: onnxruntime-1.23.2-linux-x64
83+
- run: echo "/opt/onnxruntime/lib" | sudo tee /etc/ld.so.conf.d/onnxruntime.conf && sudo ldconfig
4084
- run: cargo clippy -- -D warnings
4185

4286
fmt:

0 commit comments

Comments
 (0)