Skip to content

Commit 340cd3a

Browse files
committed
ci: add GitHub Actions workflow for testing
- Add comprehensive test workflow for Python 3.8-3.11 - Test all module imports and basic functionality - Enable test status badge functionality
1 parent ff0db4b commit 340cd3a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.8, 3.9, "3.10", "3.11"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Test imports
30+
run: |
31+
python -c "import pandas, numpy, matplotlib, yfinance, scipy, sklearn; print('All imports successful!')"
32+
33+
- name: Test data utilities
34+
run: |
35+
python -c "from src.data_utils import download_prices; print('Data utils import successful!')"
36+
37+
- name: Test optimization modules
38+
run: |
39+
python -c "from src.markowitz import markowitz_weights; print('Markowitz module import successful!')"
40+
python -c "from src.risk_parity import risk_parity_weights; print('Risk parity module import successful!')"
41+
python -c "from src.monte_carlo import monte_carlo_simulation; print('Monte Carlo module import successful!')"
42+
python -c "from src.black_litterman import black_litterman_weights; print('Black-Litterman module import successful!')"
43+
python -c "from src.ml_predictor import ml_predictor; print('ML predictor module import successful!')"
44+
python -c "from src.hybrid_model import hybrid_weights; print('Hybrid model module import successful!')"
45+
python -c "from src.custom_metrics_opt import custom_metrics_weights; print('Custom metrics module import successful!')"
46+
python -c "from src.walkforward_backtest import walkforward_backtest; print('Walkforward backtest module import successful!')"

0 commit comments

Comments
 (0)