-
Notifications
You must be signed in to change notification settings - Fork 10
77 lines (65 loc) · 2.4 KB
/
Copy pathci.yaml
File metadata and controls
77 lines (65 loc) · 2.4 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
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
# Run the exact same hooks as the local pre-commit stage (ruff, toml/yaml
# validity, link/import validation, SPDX headers, whitespace/EOF, uv-lock,
# nbstripout, ...) so CI and pre-commit can never drift. `uv` must be on
# PATH for the uv-lock hook.
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Cache pre-commit hook environments
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit hooks
run: uvx pre-commit run --all-files --show-diff-on-failure --color=always
test-cpu:
name: CPU Tests (Python ${{ matrix.python-version }})
needs: pre-commit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- run: uv sync --frozen --group dev --extra hf --extra compose
- name: Run CPU tests
run: |
# CI runs only tests/unit/ — the fast, self-contained CPU set.
# The marker filter still applies: tests that download/compose real
# models (requires_model), need CUDA (gpu), hit the network / take
# long (slow), or are the expensive code-theory suite (deep) are
# excluded.
# tests/composer/ and tests/hf/ are NOT run here: even filtered they
# are heavy enough to exhaust the GitHub Actions CPU-minutes quota and
# get killed mid-run. All of that coverage runs on the GPU cluster.
uv run pytest tests/unit/ \
-m "not requires_model and not gpu and not slow and not deep" \
-v -s --tb=short -x \
--cov=granite_switch --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false