generated from platomo/composite-action-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
52 lines (49 loc) · 1.42 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Testing Python Package
description: "Runs linter, static type checking and tests for a Python package."
inputs:
package-path:
description: "Specifies the Python package directory for coverage reporting."
required: true
py-version:
description: "Version of Python used to execute the tests."
required: true
ffmpeg-required:
description: "Determines if FFMPEG installation is needed."
required: false
default: false
test-path:
description: "Directory containing the test files."
required: false
default: tests/
runs:
using: composite
steps:
- name: Install ffmpeg
if: inputs.ffmpeg-required
uses: FedericoCarboni/setup-ffmpeg@v2
- name: Set up Python ${{ inputs.py-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.py-version }}
cache: "pip"
- name: Install Python dependencies
shell: bash
run: |
python -m pip install --upgrade pip
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
if [ -f "requirements-dev.txt" ]; then
pip install -r requirements-dev.txt
fi
- name: Linting
shell: bash
run: |
flake8 .
- name: Static type checking
shell: bash
run: |
mypy .
- name: Testing
shell: bash
run: pytest --cov=${{ inputs.package-path }} ${{ inputs.test-path }}