Skip to content

Commit f19a540

Browse files
authored
ci: Use ONNX version as cache key for the ONNX cache (Anush008#127)
Signed-off-by: Anush008 <[email protected]>
1 parent 106ab1f commit f19a540

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
name: "Cargo Tests"
22
on:
3-
pull_request:
4-
types:
5-
- opened
6-
- edited
7-
- synchronize
8-
- reopened
9-
schedule:
10-
- cron: 0 0 * * *
11-
3+
pull_request:
4+
schedule:
5+
- cron: 0 0 * * *
6+
127
env:
138
CARGO_TERM_COLOR: always
149
RUSTFLAGS: "-Dwarnings"
10+
ONNX_VERSION: v1.20.1
1511

1612
jobs:
1713
test:
@@ -24,15 +20,15 @@ jobs:
2420
id: cache-build-restore
2521
uses: actions/cache/restore@v4
2622
with:
27-
key: '${{ runner.os }}-cargox-${{ hashFiles(''**/Cargo.toml'') }}'
23+
key: '${{ runner.os }}-onnxruntime-${{ env.ONNX_VERSION }}'
2824
path: |
2925
onnxruntime/build/Linux/Release/
3026
3127
- name: Compile ONNX Runtime for Linux
3228
if: steps.cache-build-restore.outputs.cache-hit != 'true'
3329
run: |
3430
echo Cloning ONNX Runtime repository...
35-
git clone https://github.com/microsoft/onnxruntime --recursive --branch v1.20.1 --single-branch --depth 1
31+
git clone https://github.com/microsoft/onnxruntime --recursive --branch $ONNX_VERSION --single-branch --depth 1
3632
cd onnxruntime
3733
./build.sh --update --build --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync
3834
cd ..

0 commit comments

Comments
 (0)