@@ -13,13 +13,83 @@ jobs:
1313 runs-on : ubuntu-latest
1414 timeout-minutes : 20
1515 steps :
16- - uses : actions/checkout@v6
17- - uses : actions/setup-python@v6
16+ - name : Checkout
17+ uses : actions/checkout@v6
18+
19+ - name : Resolve QuantPlatformKit ref
20+ id : quant-platform-kit-ref
21+ run : |
22+ set -euo pipefail
23+ ref="main"
24+ for candidate in "${GITHUB_HEAD_REF:-}" "${GITHUB_BASE_REF:-}"; do
25+ if [ -n "$candidate" ] && git ls-remote --exit-code --heads https://github.com/QuantStrategyLab/QuantPlatformKit.git "$candidate" >/dev/null 2>&1; then
26+ ref="$candidate"
27+ break
28+ fi
29+ done
30+ echo "ref=${ref}" >> "$GITHUB_OUTPUT"
31+
32+ - name : Resolve UsEquityStrategies ref
33+ id : us-equity-strategies-ref
34+ run : |
35+ set -euo pipefail
36+ ref="main"
37+ for candidate in "${GITHUB_HEAD_REF:-}" "${GITHUB_BASE_REF:-}"; do
38+ if [ -n "$candidate" ] && git ls-remote --exit-code --heads https://github.com/QuantStrategyLab/UsEquityStrategies.git "$candidate" >/dev/null 2>&1; then
39+ ref="$candidate"
40+ break
41+ fi
42+ done
43+ echo "ref=${ref}" >> "$GITHUB_OUTPUT"
44+
45+ - name : Checkout QuantPlatformKit
46+ uses : actions/checkout@v6
47+ with :
48+ repository : QuantStrategyLab/QuantPlatformKit
49+ ref : ${{ steps.quant-platform-kit-ref.outputs.ref }}
50+ path : external/QuantPlatformKit
51+
52+ - name : Checkout UsEquityStrategies
53+ uses : actions/checkout@v6
54+ with :
55+ repository : QuantStrategyLab/UsEquityStrategies
56+ ref : ${{ steps.us-equity-strategies-ref.outputs.ref }}
57+ path : external/UsEquityStrategies
58+
59+ - name : Setup Python
60+ uses : actions/setup-python@v6
1861 with :
1962 python-version : " 3.12"
63+
2064 - name : Install dependencies
2165 run : |
66+ set -euo pipefail
2267 python -m pip install --upgrade pip
23- python -m pip install -r requirements.txt
68+ python -m pip install -r requirements.txt pytest ruff
69+
70+ - name : Smoke import pinned shared packages
71+ run : |
72+ set -euo pipefail
73+ python - <<'PY'
74+ from quant_platform_kit.common.port_adapters import CallableNotificationPort, CallablePortfolioPort
75+ from us_equity_strategies import resolve_canonical_profile
76+
77+ assert CallableNotificationPort
78+ assert CallablePortfolioPort
79+ assert resolve_canonical_profile("russell_top50_leader_rotation") == "russell_top50_leader_rotation"
80+ PY
81+
82+ - name : Install editable shared repositories
83+ run : |
84+ set -euo pipefail
85+ python -m pip install --no-deps -e external/QuantPlatformKit -e external/UsEquityStrategies
86+
87+ - name : Run ruff
88+ run : |
89+ set -euo pipefail
90+ ruff check .
91+
2492 - name : Run tests
25- run : python -m pytest -q
93+ run : |
94+ set -euo pipefail
95+ PYTHONPATH=. PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q tests
0 commit comments