-
Notifications
You must be signed in to change notification settings - Fork 434
59 lines (49 loc) · 1.47 KB
/
python-test.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
53
54
55
56
57
58
59
name: Python - test
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'python/**'
- 'tests_data/**'
- '.github/workflows/**'
pull_request:
paths:
- 'python/**'
- 'tests_data/**'
- '.github/workflows/**'
permissions:
contents: read
jobs:
unit-testing:
strategy:
matrix:
python-version: [ "3.8.x", "3.9.x", "3.10.x", "3.11.x", "3.12.x" ]
os: [ "ubuntu-latest", "macos-latest" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
- name: Setup Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # pin@v5
with:
python-version: '${{ matrix.python-version }}'
- name: Install poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 # pin@v3
with:
poetry-version: "1.7.1"
- name: Install the project dependencies
working-directory: python
run: poetry install
- name: Run ruff check
working-directory: python
run: poetry run ruff check --verbose
- name: Run ruff format check
working-directory: python
run: poetry run ruff format --check --verbose
- name: Run mypy
working-directory: python
run: poetry run mypy magika tests
- name: Run pytest
working-directory: python
run: poetry run pytest tests -m "not slow"