-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
118 lines (107 loc) · 3.45 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: CI
on:
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- 'benchmark/**'
jobs:
test_and_lint:
name: Test and lint
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: [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-latest
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 }}-uv-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-uv-${{ matrix.python-version }}-
${{ runner.os }}-uv-
- name: Install uv
run: python -m pip install --upgrade uv
- name: Install PyTorch
run: |
if [ "${{ matrix.operating-system }}" = "macos-latest" ]; then
uv pip install --system torch==2.5.1 torchvision==0.20.1
else
uv pip install --system torch==2.5.1+cpu torchvision==0.20.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu
fi
shell: bash
- name: Install all dependencies
run: |
uv pip install --system wheel
uv pip install --system -r requirements-dev.txt
uv pip install --system .
- name: Run PyTest
run: pytest --cov . --cov-report=xml
- name: Upload coverage reports to Codecov
if: matrix.operating-system == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: albumentations-team/albumentations
check_code_formatting_types:
name: Check code formatting with ruff and mypy
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.9"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install all requirements
run: |
python -m pip install --upgrade uv
uv pip install --system -r requirements-dev.txt
uv pip install --system .
- name: Run checks
run: pre-commit run --files $(find albumentations -type f)
- name: check-defaults-in-apply
run: python -m tools.check_defaults
check_transforms_docs:
name: Check Readme is not outdated
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install all requirements
run: |
python -m pip install --upgrade uv
uv pip install --system requests
uv pip install --system .
- name: Run checks for documentation
run: python -m tools.make_transforms_docs check README.md
- name: Run checks for used by documentation
run: python -m tools.make_used_by_docs check