-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 1.97 KB
/
Copy pathci.yml
File metadata and controls
71 lines (61 loc) · 1.97 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
name: CI
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Resolve QuantPlatformKit ref
id: quant-platform-kit-ref
run: |
set -euo pipefail
ref="main"
if [ -n "${GITHUB_HEAD_REF:-}" ]; then
case "${GITHUB_HEAD_REF}" in
dependabot/*)
;;
*)
if git ls-remote --exit-code --heads https://github.com/QuantStrategyLab/QuantPlatformKit.git "${GITHUB_HEAD_REF}" >/dev/null 2>&1; then
ref="${GITHUB_HEAD_REF}"
fi
;;
esac
fi
echo "ref=${ref}" >> "$GITHUB_OUTPUT"
- name: Checkout QuantPlatformKit
uses: actions/checkout@v6
with:
repository: QuantStrategyLab/QuantPlatformKit
ref: ${{ steps.quant-platform-kit-ref.outputs.ref }}
path: external/QuantPlatformKit
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
set -euo pipefail
python -m pip install --upgrade pip
python -m pip install -e . numpy pandas pandas_market_calendars pytz pytest pytest-cov ruff==0.15.22
python -m pip install --no-deps -e external/QuantPlatformKit
- name: Run Ruff
run: |
set -euo pipefail
ruff check .
- name: Check QPK pin and lock consistency
run: |
set -euo pipefail
python external/QuantPlatformKit/scripts/check_qpk_pin_consistency.py \
--root . \
--pin-file external/QuantPlatformKit/QPK_PIN
- name: Run unit tests
run: |
set -euo pipefail
PYTHONPATH=src python -m pytest -q tests --cov --cov-report=term --cov-report=xml