Repository navigation
112 lines (105 loc) · 4.25 KB
/
Copy pathci.yml
File metadata and controls
112 lines (105 loc) · 4.25 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
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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PYTHONDONTWRITEBYTECODE: "1"
PYTHONHASHSEED: "0"
jobs:
base:
name: base py${{ matrix.python-version }} / ${{ matrix.dependency-set }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.12"
dependency-set: minimum
numpy-spec: "numpy==2.2.0"
- python-version: "3.12"
dependency-set: latest
numpy-spec: "numpy>=2.2,<3"
- python-version: "3.13"
dependency-set: minimum
numpy-spec: "numpy==2.2.0"
- python-version: "3.13"
dependency-set: latest
numpy-spec: "numpy>=2.2,<3"
- python-version: "3.14"
dependency-set: minimum
numpy-spec: "numpy==2.3.2"
- python-version: "3.14"
dependency-set: latest
numpy-spec: "numpy>=2.3.2,<3"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install the base distribution
run: |
python -m pip install --upgrade pip
python -m pip install "${{ matrix.numpy-spec }}"
python -m pip install . "pytest>=8.4,<10"
- name: Verify installed-package origin
working-directory: ${{ runner.temp }}
env:
RISKLABAI_REPOSITORY_ROOT: ${{ github.workspace }}
run: python -B -c "import os; from pathlib import Path; import RiskLabAI; origin = Path(RiskLabAI.__file__).resolve(); repository = Path(os.environ['RISKLABAI_REPOSITORY_ROOT']).resolve(); assert not origin.is_relative_to(repository), (origin, repository); assert RiskLabAI.__version__ == '3.2.0'; print(origin)"
- name: Run the installed base package tests
working-directory: ${{ runner.temp }}
run: python -B -m pytest -q -p no:cacheprovider -c "$GITHUB_WORKSPACE/pyproject.toml" "$GITHUB_WORKSPACE/test"
optional:
name: optional features py${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install feature-specific optional groups
run: |
python -m pip install --upgrade pip
python -m pip install ".[speed,pde,synth,hpo,plot,symbolic,profile,simulation,changepoints,test]"
- name: Verify changepoint availability policy
run: |
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
python -B -c "import importlib.util; assert importlib.util.find_spec('ruptures') is None"
else
python -B -c "import ruptures"
fi
- name: Verify installed-package origin
working-directory: ${{ runner.temp }}
env:
RISKLABAI_REPOSITORY_ROOT: ${{ github.workspace }}
run: python -B -c "import os; from pathlib import Path; import RiskLabAI; origin = Path(RiskLabAI.__file__).resolve(); repository = Path(os.environ['RISKLABAI_REPOSITORY_ROOT']).resolve(); assert not origin.is_relative_to(repository), (origin, repository); assert RiskLabAI.__version__ == '3.2.0'; print(origin)"
- name: Run the installed optional-feature tests
working-directory: ${{ runner.temp }}
run: python -B -m pytest -q -p no:cacheprovider -c "$GITHUB_WORKSPACE/pyproject.toml" "$GITHUB_WORKSPACE/test"
quality:
name: static quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install pinned quality tools
run: python -m pip install "black==26.5.1" "ruff==0.15.17"
- name: Black
run: black --check src/RiskLabAI/causal_factor_analysis test/causal_factor_analysis
- name: Ruff
run: ruff check src/RiskLabAI/causal_factor_analysis test/causal_factor_analysis