Computer Vision live camera #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-ui: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, windows-latest, macos-latest] | |
uses: ./.github/workflows/build-ui.yml | |
with: | |
os: ${{ matrix.os }} | |
build-linux-bindings: | |
permissions: | |
contents: write | |
uses: ./.github/workflows/build-linux-bindings.yml | |
with: | |
OPENVINO_VERSION: '2024.6' | |
build-windows-bindings: | |
permissions: | |
contents: write | |
uses: ./.github/workflows/build-windows-bindings.yml | |
build-macos-bindings: | |
permissions: | |
contents: write | |
uses: ./.github/workflows/build-macos-bindings.yml | |
with: | |
OPENVINO_VERSION: '2024.6' | |
package: | |
name: Package combined release | |
runs-on: ubuntu-22.04 | |
needs: [ build-linux-bindings, build-windows-bindings, build-macos-bindings, build-ui ] | |
strategy: | |
matrix: | |
os: [linux, windows, macos] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set safe filename | |
id: set_filename | |
run: | | |
SAFE_REF_NAME=${GITHUB_REF_NAME//\//_} | |
echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-${{ matrix.os }}.zip" >> $GITHUB_ENV | |
- name: Download bindings build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: "${{ matrix.os }}_bindings.${{ matrix.os == 'windows' && 'tar' || 'tgz' }}" | |
- name: Download flutter build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: "OpenVINO-TestDrive-no-bindings-${{ matrix.os }}" | |
path: flutter | |
- name: Combine artifacts | |
run: | | |
mkdir bindings | |
tar -xvf ${{ matrix.os }}_bindings.${{ matrix.os == 'windows' && 'tar' || 'tgz' }} -C ./bindings | |
rm ${{ matrix.os }}_bindings.${{ matrix.os == 'windows' && 'tar' || 'tgz' }} | |
if [ "${{ matrix.os }}" == "macos" ]; then | |
mv bindings/* flutter/Contents/Frameworks | |
elif [ "${{ matrix.os }}" == "windows" ]; then | |
mv bindings/* flutter | |
else | |
mkdir -p flutter/data/flutter_assets/bindings | |
mv bindings/* flutter/data/flutter_assets/bindings | |
fi | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.SANITIZED_FILENAME }} | |
path: flutter | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
flutter-version-file: pubspec.yaml | |
channel: 'stable' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run tests | |
run: flutter test --coverage --no-pub | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: coverage/lcov.info | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
integration_tests: | |
runs-on: ubuntu-22.04 | |
needs: [ build-linux-bindings ] | |
env: | |
DISPLAY: ":99" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev libglu1-mesa xvfb | |
- name: Download OpenVINO bindings | |
uses: actions/download-artifact@v4 | |
with: | |
name: "linux_bindings.tgz" | |
- name: Unpack OpenVINO bindings | |
run: | | |
mkdir -p bindings | |
tar -xzf linux_bindings.tgz -C bindings | |
rm linux_bindings.tgz | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
flutter-version-file: pubspec.yaml | |
channel: 'stable' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Start Xvfb | |
run: | | |
sudo Xvfb $DISPLAY -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
echo "Xvfb started" | |
- name: Cache build | |
uses: actions/cache@v4 | |
with: | |
path: | | |
build | |
key: ${{ runner.os }}-flutter | |
- name: Run integration tests | |
run: flutter test --coverage --no-pub integration_test -d linux | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: coverage/lcov.info | |
flags: integrationtests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |