Skip to content

Commit e334a47

Browse files
committed
ci: test more versions on more platforms
This change completely refactors the "build and test" story for CI. With some unfortunate omissions (MacOS entirely, Windows dynamic linking), the bindings are checked against the last three versions of OpenVINO on more OS combinations. This is possible due to the new capabilities of the `install-openvino-action`, which downloads an OpenVINO archive and can now setup the runner environment. More work is needed, but this is a big step in the right direction. Because `install-openvino-action` is used more extensively, the previous "build and test" job using Docker is no longer needed. The Dockerfile is removed. Also, since the "build from source" option is not tested in CI, we avoid checking out all of OpenVINO's submodules, speeding up the build. Only a few C headers are necessary for the binding regeneration, IIRC.
1 parent b84ddb5 commit e334a47

File tree

3 files changed

+57
-77
lines changed

3 files changed

+57
-77
lines changed

.dockerignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,59 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13+
# Build and test the bindings using an existing OpenVINO installation.
14+
test:
15+
name: Build and test
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
# TODO: macos-latest cannot yet be included in the list because a dependency cannot be
20+
# found ("dyld: Library not loaded; '@rpath/libopenvino.2310.dylib'"). See
21+
# https://github.com/abrown/openvino-rs/actions/runs/6423141936/job/17441022932#step:7:154
22+
os: [ubuntu-20.04, ubuntu-22.04, windows-latest]
23+
version: [2022.3.0, 2023.0.1, 2023.1.0]
24+
apt: [false]
25+
# We also spot-check that things work when installing from APT by adding to the matrix: see
26+
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
27+
include:
28+
- os: ubuntu-20.04
29+
version: 2022.3.0
30+
apt: true
31+
env:
32+
RUST_LOG: debug
33+
RUST_BACKTRACE: 1
34+
steps:
35+
- uses: actions/checkout@v2
36+
with:
37+
submodules: true
38+
lfs: true
39+
- name: Checkout LFS objects
40+
run: git lfs checkout
41+
- uses: abrown/install-openvino-action@fe7412dddbed9fbd2243731a8d49f1bc55c2ba20
42+
with:
43+
version: ${{ matrix.version }}
44+
apt: ${{ matrix.apt }}
45+
- name: List files
46+
run: find $OPENVINO_INSTALL_DIR
47+
shell: bash
48+
# First, check that we can find the OpenVINO libraries; this is a canary to find any library
49+
# issues early (even if we duplicate some tests). If we run the tests in order, other tests will
50+
# short-circuit the test run and logging may not be turned on (as it is in the "find a library"
51+
# tests) for troubleshooting.
52+
- name: Check openvino-finder
53+
run: cargo test --package openvino-finder
54+
# Now, run the dynamic-linking tests: this assumes the OpenVINO library is "findable" on the
55+
# path and Cargo links the binary to it in the `build.rs` script.
56+
- name: Check dynamic linking
57+
run: cargo test
58+
# TODO: the finder does not yet know how to distinguish between `*.lib` (required here) and
59+
# `*.dll` (required by runtime-linking).
60+
if: ${{ !startsWith(runner.os, 'windows') }}
61+
# Finally, run the runtime-linking tests: the binddings do not link at build time, instead
62+
# as the tests are run.
63+
- name: Check runtime linking
64+
run: cargo test --features openvino-sys/runtime-linking
65+
1366
format:
1467
name: Check code format
1568
runs-on: ubuntu-latest
@@ -31,52 +84,13 @@ jobs:
3184
- uses: actions/checkout@v2
3285
- uses: EmbarkStudios/cargo-deny-action@v1
3386

34-
# Build and test from an existing OpenVINO installation inside a Docker image (i.e. download the
35-
# binaries, then compile against these).
36-
dynamic_binaries:
37-
name: From binaries
38-
runs-on: ubuntu-latest
39-
strategy:
40-
fail-fast: false
41-
matrix:
42-
os: [ubuntu18, ubuntu20]
43-
version: [2022.1.0, 2022.2.0, 2022.3.0]
44-
steps:
45-
- uses: actions/checkout@v2
46-
with:
47-
submodules: recursive
48-
lfs: true
49-
- name: Checkout LFS objects
50-
run: git lfs checkout
51-
- name: Build the Docker image
52-
run: docker build . --tag openvino-rs:${{ matrix.OS }}-${{ matrix.version }}-$(date +%s) --build-arg OS=${{ matrix.os }} --build-arg VERSION=${{ matrix.version }}
53-
54-
# Build and test from an existing OpenVINO installation from an archive installed on the
55-
# filesystem.
56-
runtime_binaries:
57-
name: From runtime-linked binaries
58-
runs-on: ubuntu-22.04
59-
steps:
60-
- uses: actions/checkout@v2
61-
with:
62-
submodules: recursive
63-
lfs: true
64-
- name: Checkout LFS objects
65-
run: git lfs checkout
66-
- uses: abrown/install-openvino-action@v6
67-
with:
68-
apt: true
69-
- name: Build and run tests
70-
run: cargo test --features openvino-sys/runtime-linking
71-
72-
# Check that the documentation builds.
7387
docs:
74-
name: Documentation
88+
name: Check documentation
7589
runs-on: ubuntu-latest
7690
steps:
7791
- uses: actions/checkout@v2
7892
with:
79-
submodules: recursive
93+
submodules: true
8094
lfs: true
8195
- name: Build documentation
8296
run: cargo doc --no-deps --features openvino-sys/runtime-linking
@@ -85,15 +99,15 @@ jobs:
8599
# the OpenCV dependency is a bit fragile so the crate is not included by the default workspace
86100
# commands.
87101
converter:
88-
name: Converter tool
102+
name: Check converter tool
89103
runs-on: ubuntu-20.04
90104
defaults:
91105
run:
92106
working-directory: crates/openvino-tensor-converter
93107
steps:
94108
- uses: actions/checkout@v2
95109
with:
96-
submodules: recursive
110+
submodules: true
97111
- name: Install OpenCV
98112
run: sudo apt update && sudo apt install libclang-dev libopencv-dev libopencv-core4.2
99113
- name: Build

Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)