forked from quantopian/pyfolio
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (78 loc) · 2.94 KB
/
quick-test.yml
File metadata and controls
91 lines (78 loc) · 2.94 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Quick Test
# Trigger on any push to any branch
on:
push:
# Run on all branches
branches: '**'
# Skip if only documentation files are changed
paths-ignore:
- '**.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
- '.github/workflows/manual-test.yml'
jobs:
quick-test:
name: Quick Test - Python 3.11 on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pytest-xdist parameterized
# Install all package dependencies first
pip install ipython>=7.0.0 matplotlib>=3.0.0 numpy>=1.20.0 pandas>=1.3.0
pip install flask>=2.0.0 pytz>=2019.3 scikit-learn>=0.22.0 scipy>=1.5.0 seaborn>=0.10.0
# Install empyrical
pip install git+https://github.com/cloudQuant/empyrical.git || pip install git+https://gitee.com/yunjinqi/empyrical.git
# Install pyfolio without dependencies
pip install -e . --no-deps
- name: Run tests
run: |
pytest tests/ -v -x --tb=short -n auto
- name: Test import
run: |
python -c "import pyfolio; print(f'Successfully imported pyfolio {pyfolio.__version__}')"
# Run full matrix test only on main branches
full-test:
name: Full Test - ${{ matrix.python-version }} on ${{ matrix.os }}
needs: quick-test
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pytest-xdist parameterized
# Install all package dependencies first
pip install ipython>=7.0.0 matplotlib>=3.0.0 numpy>=1.20.0 pandas>=1.3.0
pip install flask>=2.0.0 pytz>=2019.3 scikit-learn>=0.22.0 scipy>=1.5.0 seaborn>=0.10.0
# Install empyrical
pip install git+https://github.com/cloudQuant/empyrical.git || pip install git+https://gitee.com/yunjinqi/empyrical.git
# Install pyfolio without dependencies
pip install -e . --no-deps
- name: Run tests
run: |
pytest tests/ -v --cov=pyfolio --cov-report=term