-
Notifications
You must be signed in to change notification settings - Fork 24
131 lines (123 loc) · 4.45 KB
/
main.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
permissions: read-all
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
# Build and test the bindings using an existing OpenVINO installation.
test:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
# TODO: macos-latest cannot yet be included in the list because a dependency cannot be
# found ("dyld: Library not loaded; '@rpath/libopenvino.2310.dylib'"). See
# https://github.com/abrown/openvino-rs/actions/runs/6423141936/job/17441022932#step:7:154
os: [ubuntu-20.04, ubuntu-22.04, windows-latest]
version: [2023.2.0, 2024.0.0, 2024.1.0]
apt: [false]
# We also spot-check that things work when installing from APT by adding to the matrix: see
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
# APT install and check latest supported version 2024.1.0
include:
- os: ubuntu-22.04
version: 2024.1.0
apt: true
env:
RUST_LOG: debug
RUST_BACKTRACE: 1
steps:
- name: Enable long paths
run: git config --global core.longpaths true
- uses: actions/checkout@v2
with:
submodules: true
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- uses: abrown/install-openvino-action@v8
with:
version: ${{ matrix.version }}
apt: ${{ matrix.apt }}
- name: List files
run: find $OPENVINO_INSTALL_DIR
shell: bash
# First, check that we can find the OpenVINO libraries; this is a canary to find any library
# issues early (even if we duplicate some tests). If we run the tests in order, other tests will
# short-circuit the test run and logging may not be turned on (as it is in the "find a library"
# tests) for troubleshooting.
- name: Check openvino-finder
run: cargo test --package openvino-finder
# Now, run the dynamic-linking tests: this assumes the OpenVINO library is "findable" on the
# path and Cargo links the binary to it in the `build.rs` script.
- name: Check dynamic linking
run: cargo test
# Finally, run the runtime-linking tests: the binddings do not link at build time, instead
# as the tests are run.
- name: Check runtime linking
run: cargo test --features openvino-sys/runtime-linking
format:
name: Check code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
# Use the `runtime-linking` feature here to avoid requiring an OpenVINO installation to be
# present when building.
- run: cargo clippy --features runtime-linking
- run: cd crates/openvino-tensor-converter && cargo fmt --all -- --check
rust_dependencies:
name: Check Rust dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
docs:
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
lfs: true
- name: Build documentation
run: cargo doc --no-deps --features openvino-sys/runtime-linking
# Build and test the openvino-tensor-converter tool separately from the regular library builds;
# the OpenCV dependency is a bit fragile so the crate is not included by the default workspace
# commands.
converter:
name: Check converter tool
runs-on: ubuntu-20.04
defaults:
run:
working-directory: crates/openvino-tensor-converter
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install OpenCV
run: sudo apt update && sudo apt install libclang-dev libopencv-dev libopencv-core4.2
- name: Build
run: cargo build -v
- name: test
run: cargo test -v
# Re-generate the openvino-sys bindings and check if anything has changed. A failure in this step
# indicates that we need to decide wether to commit the changes from `cargo xtask codegen`.
codegen:
name: Generate openvino-sys bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Generate bindings
run: cargo xtask codegen
- name: Verify no changes
run: git diff --ignore-submodules --no-ext-diff --name-only --exit-code