Spaces:
Sleeping
Sleeping
Fabio Grasso
commited on
ci: add github workflow
Browse files
.github/workflows/python-app.yml
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
| 2 |
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
| 3 |
+
|
| 4 |
+
name: Python application
|
| 5 |
+
|
| 6 |
+
on:
|
| 7 |
+
push:
|
| 8 |
+
branches: [ "main" ]
|
| 9 |
+
pull_request:
|
| 10 |
+
branches: [ "main" ]
|
| 11 |
+
|
| 12 |
+
permissions:
|
| 13 |
+
contents: read
|
| 14 |
+
|
| 15 |
+
jobs:
|
| 16 |
+
build:
|
| 17 |
+
|
| 18 |
+
runs-on: ubuntu-latest
|
| 19 |
+
|
| 20 |
+
steps:
|
| 21 |
+
- uses: actions/checkout@v3
|
| 22 |
+
- name: Set up Python 3.10
|
| 23 |
+
uses: actions/setup-python@v3
|
| 24 |
+
with:
|
| 25 |
+
python-version: "3.10"
|
| 26 |
+
cache: 'pip'
|
| 27 |
+
- name: Install dependencies
|
| 28 |
+
run: |
|
| 29 |
+
sudo apt-get update
|
| 30 |
+
sudo apt-get install -y ffmpeg
|
| 31 |
+
python -m pip install --upgrade pip
|
| 32 |
+
pip install flake8 pytest
|
| 33 |
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
| 34 |
+
- name: Lint with Ruff
|
| 35 |
+
run: |
|
| 36 |
+
pip install ruff
|
| 37 |
+
ruff --format=github --target-version=py37 .
|
| 38 |
+
continue-on-error: true
|
| 39 |
+
- name: Test with pytest
|
| 40 |
+
run: |
|
| 41 |
+
pip install pytest pytest-cov
|
| 42 |
+
pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
|