Skip to content

Commit

Permalink
ci: test more versions on more platforms
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abrown committed Oct 5, 2023
1 parent b84ddb5 commit e334a47
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 77 deletions.
6 changes: 0 additions & 6 deletions .dockerignore

This file was deleted.

100 changes: 57 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,59 @@ 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: [2022.3.0, 2023.0.1, 2023.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
include:
- os: ubuntu-20.04
version: 2022.3.0
apt: true
env:
RUST_LOG: debug
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v2
with:
submodules: true
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- uses: abrown/install-openvino-action@fe7412dddbed9fbd2243731a8d49f1bc55c2ba20
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
# TODO: the finder does not yet know how to distinguish between `*.lib` (required here) and
# `*.dll` (required by runtime-linking).
if: ${{ !startsWith(runner.os, 'windows') }}
# 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
Expand All @@ -31,52 +84,13 @@ jobs:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1

# Build and test from an existing OpenVINO installation inside a Docker image (i.e. download the
# binaries, then compile against these).
dynamic_binaries:
name: From binaries
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu18, ubuntu20]
version: [2022.1.0, 2022.2.0, 2022.3.0]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Build the Docker image
run: docker build . --tag openvino-rs:${{ matrix.OS }}-${{ matrix.version }}-$(date +%s) --build-arg OS=${{ matrix.os }} --build-arg VERSION=${{ matrix.version }}

# Build and test from an existing OpenVINO installation from an archive installed on the
# filesystem.
runtime_binaries:
name: From runtime-linked binaries
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- uses: abrown/install-openvino-action@v6
with:
apt: true
- name: Build and run tests
run: cargo test --features openvino-sys/runtime-linking

# Check that the documentation builds.
docs:
name: Documentation
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
submodules: true
lfs: true
- name: Build documentation
run: cargo doc --no-deps --features openvino-sys/runtime-linking
Expand All @@ -85,15 +99,15 @@ jobs:
# the OpenCV dependency is a bit fragile so the crate is not included by the default workspace
# commands.
converter:
name: Converter tool
name: Check converter tool
runs-on: ubuntu-20.04
defaults:
run:
working-directory: crates/openvino-tensor-converter
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
submodules: true
- name: Install OpenCV
run: sudo apt update && sudo apt install libclang-dev libopencv-dev libopencv-core4.2
- name: Build
Expand Down
28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

0 comments on commit e334a47

Please sign in to comment.