Skip to content

Merge pull request #4 from sunsided/feature/update-openvx #21

Merge pull request #4 from sunsided/feature/update-openvx

Merge pull request #4 from sunsided/feature/update-openvx #21

Workflow file for this run

---
name: Rust
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
openvx_setup:
name: Setup OpenVX
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Get commit hash of submodule
id: get-hash
run: echo "hash=$(git -C vendor/openvx-sample-impl rev-parse HEAD)" >> GITHUB_OUTPUT
- name: Setup caching
uses: actions/cache@v4
id: cache
with:
path: vendor/openvx-sample-impl/install
key: OpenVXCacheKey-${{ steps.get-hash.outputs.hash }}
- name: Install OpenCL
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y ocl-icd-opencl-dev intel-opencl-icd cmake
- name: Build OpenVX
if: steps.cache.outputs.cache-hit != 'true'
working-directory: vendor/openvx-sample-impl
run: |
python Build.py \
--os=Linux --arch=64 --conf=Release \
--c=clang --cpp=clang \
--conf_vision --conf_nn \
--opencl_interop --enh_vision --ix \
--streaming --pipelining
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: openvx_artifacts
path: vendor/openvx-sample-impl/install/Linux
test:
name: Run tests
needs:
- openvx_setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download OpenVX artifacts
uses: actions/download-artifact@v4
with:
name: openvx_artifacts
path: vendor/openvx-sample-impl/install/Linux
- name: Set OpenVX path
run: |
echo "OPENVX_DIR=${GITHUB_WORKSPACE}/vendor/openvx-sample-impl/install/Linux/x64/Release" >> $GITHUB_ENV
- name: Set OpenVX library paths
run: |
echo "LIBRARY_PATH=${OPENVX_DIR}/bin" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${OPENVX_DIR}/bin" >> $GITHUB_ENV
- name: Install OpenCL
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev libopencv-dev ocl-icd-opencl-dev intel-opencl-icd
- name: Build libraries and sample
run: cargo build
- name: Run Docests
run: cargo test --doc
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true