-
Notifications
You must be signed in to change notification settings - Fork 56
130 lines (97 loc) · 3.67 KB
/
Copy pathci.yml
File metadata and controls
130 lines (97 loc) · 3.67 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on:
pull_request:
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: .python-version
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --locked --extra dev --extra docs
- name: Run linting via pre-commit
run: uv run --locked pre-commit run --all-files --show-diff-on-failure
- name: Build documentation
run: |
set -eE
set -o pipefail
uv run --locked --extra docs sphinx-build -M html "doc" "doc/_build"
touch doc/_build/html/.nojekyll
test:
name: Run pytest (3.14)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --locked --python 3.14 --extra dev
- name: Run pytest
run: |
set -eEx
set -o pipefail
uv run --locked --python 3.14 --extra dev python -m pytest -vv --cov
# <100% coverage might indicate that some tests are not doing what they should,
# but realistically, it might too hard to reach, so lower it a bit
# (at the moment of writing, it is 99.95%)
uv run --locked --python 3.14 --extra dev coverage report --include='tests/*' --precision=2 --fail-under=97.00
uv run --locked --python 3.14 --extra dev python -m pytest --dead-fixtures
uv run --locked --python 3.14 --extra dev python -m pytest -vv -m ci_only
smoke:
name: Smoke test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.14"]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Test local installation
run: |
set -eE
set -o pipefail
python -m venv .smoke-venv
.smoke-venv/bin/python -m pip install .
.smoke-venv/bin/python -m pip uninstall --yes cloudai
.smoke-venv/bin/python -m pip install --editable .
- name: Test commands
run: |
set -eEx
set -o pipefail
.smoke-venv/bin/cloudai --help
# this checks that all TOMLs are valid, Test Scenarios are checked for _all_ tests
.smoke-venv/bin/cloudai verify-configs conf/
# this checks that all TOMLs are valid, Test Scenarios are checked _only_ the tests in the specified directory
.smoke-venv/bin/cloudai verify-configs --tests-dir conf/common/test conf/common
.smoke-venv/bin/cloudai verify-configs --tests-dir conf/release/spcx/l40s/test conf/release/spcx/l40s
# set monitor_interval to 1 to speed up the test
sed -i '/scheduler =/a monitor_interval = 1' conf/common/system/example_slurm_cluster.toml
.smoke-venv/bin/cloudai dry-run --system-config conf/common/system/example_slurm_cluster.toml \
--tests-dir conf/common/test/ \
--test-scenario conf/common/test_scenario/sleep.toml \
--output-dir ./results