-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
75 lines (64 loc) · 2.04 KB
/
Copy pathpython-package.yml
File metadata and controls
75 lines (64 loc) · 2.04 KB
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
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8] #3.9 fails due to opencv-headless version
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Install tensorflow
if: matrix.python-version < 3.8
run: pip install tensorflow==1.15.5
- name: Install ffmpeg
if: matrix.python-version < 3.8
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install ffmpeg
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install ffmpeg
else
choco install ffmpeg
fi
shell: bash
- name: Run pytest tests
if: matrix.python-version < 3.8
run: |
pip install pytest
python -m pytest
- name: Run functional tests
if: matrix.python-version < 3.8
run: |
pip install git+git://github.com/${{ github.repository }}.git@${{ github.sha }}
python examples/testscript.py
python examples/testscript_multianimal.py