Skip to content

Add GitHub Actions workflow for test coverage #14

Add GitHub Actions workflow for test coverage

Add GitHub Actions workflow for test coverage #14

name: Test Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
# This workaround will be fixed after integration with the building workflow for OpenVINO bindings
env:
BINDINGS_RELEASE: untagged-7fa30b9a6a885e38ac9d
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Download OpenVINO bindings
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p bindings
gh release download ${{ env.BINDINGS_RELEASE }} -p linux_bindings.tgz
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: Run tests
run: flutter test --coverage --no-pub
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
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
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev
- name: Download OpenVINO bindings
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p bindings
gh release download ${{ env.BINDINGS_RELEASE }} -p linux_bindings.tgz
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: Run integration tests
run: flutter test --coverage --no-pub integration_test -d linux
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: coverage/lcov.info
flags: integrationtests
name: codecov-umbrella
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}