Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS build workflow for GitHub Actions #82

Draft
wants to merge 47 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
fb58743
Enabled integration tests
ActiveChooN Dec 16, 2024
ded2621
Added multi-os build pipeline
ActiveChooN Dec 16, 2024
ac63f8b
Added permissions
ActiveChooN Dec 16, 2024
4ee7629
Fixed workflow
ActiveChooN Dec 16, 2024
22daea6
Disabled other workflows
ActiveChooN Dec 16, 2024
c5b62d1
Changed shell to bash for windows
ActiveChooN Dec 16, 2024
e25fd79
Fixed minor issues
ActiveChooN Dec 18, 2024
720be3e
Merge remote-tracking branch 'origin/main' into dkalinin/integration-…
ActiveChooN Dec 19, 2024
45bd440
Fixed workflow
ActiveChooN Dec 19, 2024
96de231
FIxed workflow
ActiveChooN Dec 19, 2024
d1ee04e
Fixed workflow
ActiveChooN Dec 19, 2024
fa6cf33
Fixed workflow
ActiveChooN Dec 19, 2024
7a38117
Fixed workflow
ActiveChooN Dec 19, 2024
baaa4e0
Fixed workflow
ActiveChooN Dec 19, 2024
b9b2567
Fixed workflow
ActiveChooN Dec 19, 2024
3cafae5
Fixed windows cmake
ActiveChooN Dec 20, 2024
925b49e
Separated bundling step
ActiveChooN Jan 8, 2025
a3b5031
Fixed ui build
ActiveChooN Jan 8, 2025
12ec6fa
debug
ActiveChooN Jan 9, 2025
2a0f06d
debug
ActiveChooN Jan 9, 2025
88560a3
Debug
ActiveChooN Jan 9, 2025
41e8e36
Refactoring macOS library bundling and signing in proccess
ActiveChooN Jan 13, 2025
2bce9d5
Fixed build with ffmpeg
ActiveChooN Jan 14, 2025
7f3ed47
Fixed build step
ActiveChooN Jan 14, 2025
9d743d0
First attempt on macos bindings build
ActiveChooN Jan 15, 2025
7f01770
WIP macos build
ActiveChooN Jan 15, 2025
378cc08
Added package step
ActiveChooN Jan 16, 2025
3985cc0
Enabled workflow
ActiveChooN Jan 16, 2025
93ae36b
Fixed filename in package step
ActiveChooN Jan 16, 2025
6d533e5
Fixed trigger
ActiveChooN Jan 16, 2025
34ff675
Build fix
ActiveChooN Jan 16, 2025
b869a6a
Fix build
ActiveChooN Jan 16, 2025
5438ab5
Fixed build
ActiveChooN Jan 16, 2025
6cd5759
Fixed build
ActiveChooN Jan 16, 2025
e111a4c
Fixed typo
ActiveChooN Jan 17, 2025
52b29eb
Removed debug
ActiveChooN Jan 17, 2025
eda28d5
Fixed ffmpeg installation
ActiveChooN Jan 17, 2025
3fa0710
Trying to fix linux build
ActiveChooN Jan 17, 2025
45a59a7
Fix build
ActiveChooN Jan 17, 2025
168670c
Fixed build
ActiveChooN Jan 17, 2025
c2f1e65
Combined package jobs
ActiveChooN Jan 17, 2025
f2f31ca
Included test jobs into main workflow
ActiveChooN Jan 17, 2025
03893bb
Fixed build
ActiveChooN Jan 17, 2025
dcbcd21
Fixed workflow
ActiveChooN Jan 17, 2025
22620b7
Fixed workflow
ActiveChooN Jan 17, 2025
5865baa
Fixed test workflow
ActiveChooN Jan 20, 2025
d042fcb
Fixed imports
ActiveChooN Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
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:
name: Build Linux Bindings
runs-on: ubuntu-22.04-16-cores
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: |
cd openvino_bindings
docker build -f Dockerfile.ubuntu -t linux-bindings-ubuntu .
docker create --name bindings_container linux-bindings-ubuntu
docker cp bindings_container:/bindings-out/linux_bindings.tgz ./linux_bindings.tgz
- name: Upload bindings to artifacts
uses: actions/upload-artifact@v4
with:
name: "linux_bindings.tgz"
path: openvino_bindings/linux_bindings.tgz
if-no-files-found: error

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

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:
flutter-version-file: pubspec.yaml

- 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-latest
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:
flutter-version-file: pubspec.yaml

- 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: 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 }}
48 changes: 48 additions & 0 deletions .github/workflows/build-macos-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build MacOS Bindings

on:
workflow_call:

jobs:
build-macos-bindings:
name: Build MacOS Bindings
runs-on: macos-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Install OpenVINO
run: |
curl -L https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/2024.6/macos/openvino_genai_macos_12_6_2024.6.0.0_arm64.tar.gz \
-o /tmp/openvino.tar.gz
sudo mkdir /opt/intel
sudo tar -xvf /tmp/openvino.tar.gz -C /opt/intel
sudo mv /opt/intel/openvino_genai_macos_12_6_2024.6.0.0_arm64 /opt/intel/openvino
rm /tmp/openvino.tar.gz
ls /opt/intel/openvino

- name: Install OpenCV
run: |
sudo /bin/bash openvino_bindings/scripts/setup_opencv.sh

- name: Install ffmpeg
run: |
sudo /bin/bash openvino_bindings/scripts/setup_ffmpeg.sh

- name: Install numpy
run: |
brew install numpy

- name: Build bindings
run: |
bazelisk build :macos_bindings
working-directory: openvino_bindings

- name: Upload bindings to artifacts
uses: actions/upload-artifact@v4
with:
name: "macos_bindings.tgz"
path: "openvino_bindings/bazel-bin/macos_bindings.tgz"
if-no-files-found: error
55 changes: 55 additions & 0 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build UI

on:
workflow_call:
inputs:
os:
required: true
description: 'The operating system to build for'
type: string

jobs:
build-ui:
name: Build UI
runs-on: ${{ inputs.os }}
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Determine comon OS vars
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
echo "RELEASE_PATH=build/linux/x64/release/bundle" >> $GITHUB_ENV
elif [[ "${{ runner.os }}" == "Windows" ]]; then
echo "RELEASE_PATH=build/windows/x64/runner/Release" >> $GITHUB_ENV
elif [[ "${{ runner.os }}" == "macOS" ]]; then
mkdir bindings
echo "RELEASE_PATH=build/macos/Build/Products/Release/OpenVINO Test Drive.app" >> $GITHUB_ENV
fi
echo "OS_NAME=`echo '${{runner.os}}' | tr '[:upper:]' '[:lower:]'`" >> $GITHUB_ENV
- uses: subosito/[email protected]
with:
channel: 'stable'
flutter-version-file: pubspec.yaml
cache: true
- name: Install linux dependencies
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable build
run: flutter config --enable-${{env.OS_NAME}}-desktop
- name: Build artifacts
run: flutter build ${{env.OS_NAME}} --release
env:
FLUTTER_NOT_BUNDLE_LIBRARIES: true
FLUTTER_NOT_SIGN_LIBS: true
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "OpenVINO-TestDrive-no-bindings-${{env.OS_NAME}}"
path: ${{ env.RELEASE_PATH }}
Loading
Loading