Add GitHub Actions workflow for test coverage #9
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: 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: | | |
gh release list | |
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: | |
channel: stable | |
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: Download OpenVINO bindings | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
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: | |
channel: stable | |
flutter-version-file: pubspec.yaml | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run integration tests | |
run: flutter test --coverage --no-pub integration_test | |
- 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 }} |