Skip to content

Update build.yml for Azure Pipelines #35

Update build.yml for Azure Pipelines

Update build.yml for Azure Pipelines #35

Workflow file for this run

name: Coverage
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ${{ matrix.agent }}
name: '${{ matrix.build_type }} ${{ matrix.compiler }} ${{ matrix.compiler_version }}'
strategy:
fail-fast: false
matrix:
include:
- agent: ubuntu-22.04
compiler: gcc
compiler_version: '12'
activate_virtual_env: 'source .venv/bin/activate'
build_type: 'Debug'
- agent: ubuntu-22.04
compiler: gcc
compiler_version: '12'
activate_virtual_env: 'source .venv/bin/activate'
build_type: 'Release'
- agent: ubuntu-22.04
compiler: clang
compiler_version: '15'
activate_virtual_env: 'source .venv/bin/activate'
build_type: 'Debug'
- agent: ubuntu-22.04
compiler: clang
compiler_version: '15'
activate_virtual_env: 'source .venv/bin/activate'
build_type: 'Release'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
- name: Cache Virtual Environment
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.build_type }}-${{ hashFiles('scripts/requirements.txt') }}
- name: Cache Conan
uses: actions/cache@v3
with:
path: .conan
key: conan-${{ runner.os }}-${{ matrix.build_type }}-${{ hashFiles('video_io/conanfile.txt', 'video_io/tests/conanfile.txt') }}
- name: Setup Virtual Environment
if: steps.cache.outputs.cache-hit != 'true'
run: |
python3 -m venv .venv
source .venv/bin/activate
pip install -r scripts/requirements.txt
- name: Setup Conan
run: |
source .venv/bin/activate
python3 scripts/conan/setup.py ${{ matrix.build_type }} ${{ matrix.compiler }} ${{ matrix.compiler_version }} -d video_io video_io/tests
- name: Create Unit Tests data
run: |
sudo apt-get install -y ffmpeg
python3 scripts/tests/generate_test_data.py
- name: Run Code Coverage
run: |
source .venv/bin/activate
python3 scripts/cmake.py ${{ matrix.build_type }} ${{ matrix.compiler }} ${{ matrix.compiler_version }} --warnings --coverage
python3 scripts/tools/run_unit_tests.py ${{ matrix.build_type }}
python3 scripts/tools/run_coverage.py ${{ matrix.compiler }} ${{ matrix.compiler_version }}
timeout-minutes: 5
continue-on-error: true
env:
CONAN_USER_HOME: ${{ github.workspace }}
- name: Upload Codecov
uses: codecov/codecov-action@v4
with:
files: './results/coverage/cobertura.xml'
name: TeiaCareVideoIO
slug: TeiaCare/TeiaCareVideoIO
token: ${{secrets.CODECOV_TOKEN}}
flags: '${{ matrix.build_type }} ${{ matrix.compiler }} ${{ matrix.compiler_version }}'
- name: Upload Codacy
if: ${{ matrix.build_type == 'Release' && matrix.compiler == 'gcc' }}
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r results/coverage/cobertura.xml
env:
CODACY_PROJECT_TOKEN: ${{secrets.CODACY_TOKEN}}