-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.83 KB
/
Copy pathci.yml
File metadata and controls
63 lines (52 loc) · 1.83 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
name: CI
on:
pull_request:
push:
branches: [main]
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="$(grep -Eo 'QuantPlatformKit\.git@[0-9a-f]+' pyproject.toml | head -n1 | sed 's/.*@//')"
echo "ref=${ref}" >> "$GITHUB_OUTPUT"
- name: Resolve CnEquityStrategies ref
id: cn-equity-strategies-ref
run: |
set -euo pipefail
ref="$(grep -Eo 'CnEquityStrategies\.git@[0-9a-f]+' pyproject.toml | head -n1 | sed 's/.*@//')"
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: Checkout CnEquityStrategies
uses: actions/checkout@v6
with:
repository: QuantStrategyLab/CnEquityStrategies
ref: ${{ steps.cn-equity-strategies-ref.outputs.ref }}
path: external/CnEquityStrategies
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
set -euo pipefail
python -m pip install --upgrade pip
python -m pip install -e '.[test]' ruff
python -m pip install --no-deps -e external/QuantPlatformKit -e external/CnEquityStrategies
- name: Run ruff
run: python -m ruff check . --extend-exclude external
- name: Run tests
run: PYTHONPATH=. PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q tests