-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.31 KB
/
test_python.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python Install and Tests
on:
push:
paths:
- 'src/**'
- 'tests/**'
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install just the lint dependencies first
run: python -m pip install flake8 isort ruff
- name: Lint with ruff
run: ruff check
- name: Check format with ruff
run: ruff format --check
- name: Install dependencies
run: |
sudo apt install libimage-exiftool-perl -y
python -m pip install --upgrade pip
python -m pip install .[lint,test,pipeline]
- name: Test with pytest
run: |
if [ "${{ inputs.coverage_threshold }}" -gt 0 ]; then
pytest --cov-fail-under=${{ inputs.coverage_threshold }} --cov-report xml:coverage.xml
else
pytest --cov-report xml:coverage.xml
fi
- uses: actions/upload-artifact@v4
with:
name: coverage.xml
path: coverage.xml