-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
104 lines (101 loc) · 2.9 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
name: CI
on:
push:
branches:
- master
pull_request:
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.8, 3.9, "3.10", "3.11"]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Show OS and Python version
run: |
echo "OS: ${{ matrix.operating-system }}"
echo "Python: ${{ matrix.python-version }}"
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install wheel
run: python -m pip install --upgrade wheel
- name: Install PyTorch on Linux and Windows
if: >
matrix.operating-system == 'ubuntu-latest' ||
matrix.operating-system == 'windows-latest'
run: >
pip install torch==2.0.1 torchvision==0.15.2
--extra-index-url https://download.pytorch.org/whl/cpu
- name: Install PyTorch on MacOS
if: matrix.operating-system == 'macos-latest'
run: pip install torch==2.0.1 torchvision==0.15.2
- name: Install dependencies
run: pip install .[tests]
- name: Cleanup the build directory
uses: JesseTG/[email protected]
with:
path: build
- name: Run PyTest
run: pytest
check_code_formatting_types:
name: Check code formatting with Black, isort, mypy, flake8
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install linters
run: >
pip install
flake8==5.0.3
flake8-docstrings==1.6.0
isort==5.11.5
mypy==0.991
types-PyYAML
types-setuptools
types-pkg-resources
black==22.6.0
- name: Run Black
run: black --config=black.toml --check .
- name: Run Flake8
run: flake8
- name: Run mypy
run: mypy .
- name: Run isort
run: isort --profile black albumentations
check_transforms_docs:
name: Check that transforms docs are not outdated
runs-on: ubuntu-latest
strategy:
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: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: pip install .[develop]
- name: Run checks
run: python tools/make_transforms_docs.py check README.md