Skip to content

Deprecate on_shutdown in favor of lifespan (Fixes #397) #365

Deprecate on_shutdown in favor of lifespan (Fixes #397)

Deprecate on_shutdown in favor of lifespan (Fixes #397) #365

Workflow file for this run

# Copyright (c) 2019 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Run Linux CI-Tests for vidgear
on:
push:
branches:
- testing
paths-ignore:
- "**/*.md"
- "**/*.html"
- "**/*.js"
- "**/*.css"
- "docs/**/*"
- README.md
- mkdocs.yml
pull_request:
branches:
- testing
paths-ignore:
- "**/*.md"
- "docs/**/*"
jobs:
test:
name: CI Test vidgear
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install apt_dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq unzip wget -y
sudo apt-get install -qq dos2unix -y
sudo apt-get install ffmpeg v4l2loopback-dkms v4l2loopback-utils linux-modules-extra-$(uname -r) -y
- name: prepare bash_scripts
run: |
dos2unix scripts/bash/prepare_dataset.sh
chmod +x scripts/bash/prepare_dataset.sh
dos2unix scripts/bash/install_opencv.sh
chmod +x scripts/bash/install_opencv.sh
- name: install pip_dependencies
run: |
pip install -U pip wheel numpy
pip install -U .[asyncio]
pip uninstall opencv-python -y
pip install -U flake8 six codecov httpx pytest pytest-asyncio pytest-cov yt_dlp mpegdash paramiko m3u8 async-asgi-testclient
pip install -U deffcode
pip install cryptography==38.0.4
if: success()
- name: run prepare_dataset_script
run: bash scripts/bash/prepare_dataset.sh
shell: bash
- name: run install_opencv_script
run: bash scripts/bash/install_opencv.sh
shell: bash
- name: recheck pip_dependencies
run: pip install .[core]
- name: pytest with_ENV
run: |
mkdir -p $HOME/logs
export VIDGEAR_LOGFILE="$HOME/logs"
timeout 1200 pytest --verbose --cov=vidgear --cov-report=xml --cov-report term-missing vidgear/tests/ || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; else echo "EXIT_CODE=$code" >>$GITHUB_ENV; fi
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
if: success() && matrix.python-version == 3.7
- name: pytest without_ENV
run: |
sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera'
timeout 1200 pytest --verbose --cov=vidgear --cov-report=xml --cov-report term-missing vidgear/tests/ || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; else echo "EXIT_CODE=$code" >>$GITHUB_ENV; fi
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
if: success() && matrix.python-version != 3.7
- name: Display exit code
run: echo "Exit code was = $EXIT_CODE"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: ${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
if: ${{ env.EXIT_CODE != '124' }}