-
-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (84 loc) · 2.51 KB
/
ci.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
pull_request:
branches:
- main
paths-ignore:
- 'CONTRIBUTORS.md'
- 'README.md'
- 'benchmarks/results/**'
jobs:
test_and_lint:
name: Test and lint
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-13]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
include:
- operating-system: ubuntu-latest
path: ~/.cache/pip
- operating-system: windows-latest
path: ~\AppData\Local\pip\Cache
- operating-system: macos-13
path: ~/Library/Caches/pip
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python packages
uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install wheel
run: python -m pip install --upgrade wheel
- name: Install dev requirements
run: pip install -r requirements-dev.txt
- name: Install dependencies
run: |
python -m ensurepip --upgrade
pip install .
- name: Cleanup the build directory
uses: JesseTG/rm@v1.0.3
with:
path: build
- name: Run PyTest
run: pytest --cov .
- name: Upload coverage reports to Codecov
if: matrix.operating-system == 'ubuntu-latest' && matrix.python-version == '3.8'
uses: codecov/codecov-action@v4.3.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: albumentations-team/albucore
check_code_formatting_types:
name: Check code formatting with ruff and mypy
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install .
- name: Install dev requirements
run: pip install -r requirements-dev.txt
- name: Run checks
run: pre-commit run