-
Notifications
You must be signed in to change notification settings - Fork 71
145 lines (140 loc) · 4.49 KB
/
tests.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
- 'feature/**'
jobs:
style_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8==5.0.4 pytest
- name: Style check
run: flake8 .
unit_tests:
runs-on: ubuntu-latest
needs: style_check
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[blpapi]" --extra-index-url https://blpapi.bloomberg.com/repository/releases/python/simple
pip install flake8==5.0.4 pytest
pip install coverage
- name: Unit tests
env:
QUANTFIN_SECRET: ${{ secrets.QUANTFIN_SECRET }}
run: |
coverage run -m pytest qf_lib/tests/unit_tests
coverage xml -o unit_tests.xml
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: unit_tests
path: unit_tests.xml
backtesting_tests:
runs-on: ubuntu-latest
needs: style_check
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[blpapi]" --extra-index-url https://blpapi.bloomberg.com/repository/releases/python/simple
pip install flake8==5.0.4 pytest
pip install coverage
- name: Integration tests
env:
QUANTFIN_SECRET: ${{ secrets.QUANTFIN_SECRET }}
run: |
coverage run -a -m pytest qf_lib/tests/integration_tests/backtesting
coverage xml -o backtesting_tests.xml
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: backtesting_tests
path: backtesting_tests.xml
data_providers_tests:
runs-on: ubuntu-latest
needs: style_check
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[blpapi]" --extra-index-url https://blpapi.bloomberg.com/repository/releases/python/simple
pip install flake8==5.0.4 pytest
pip install coverage
- name: Integration tests
env:
QUANTFIN_SECRET: ${{ secrets.QUANTFIN_SECRET }}
run: |
coverage run -a -m pytest qf_lib/tests/integration_tests/data_providers
coverage xml -o data_providers_tests.xml
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: data_providers_tests
path: data_providers_tests.xml
codecov_upload:
runs-on: ubuntu-latest
needs: [unit_tests, data_providers_tests, backtesting_tests]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download unit_tests artifacts
uses: actions/download-artifact@v3
with:
name: unit_tests
- name: Download artifacts data_providers_tests
uses: actions/download-artifact@v3
with:
name: data_providers_tests
- name: Download backtesting_tests artifacts
uses: actions/download-artifact@v3
with:
name: backtesting_tests
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8==5.0.4 pytest
pip install coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./unit_tests.xml, ./data_providers_tests.xml, ./backtesting_tests.xml
fail_ci_if_error: true
name: qf-lib-codecov
verbose: true