-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 2.64 KB
/
Copy pathvalidate.yml
File metadata and controls
73 lines (60 loc) · 2.64 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
# ============================================================
# .github/workflows/validate.yml (Validation Workflow)
# ============================================================
# Updated: 2026-04-26 (REPO-SPECIFIC)
# PURPOSE: Run all validation checks and build the coverage matrix.
name: Validate
on:
push:
pull_request:
workflow_call: # WHY: Allow this workflow to be called by other workflows if needed
workflow_dispatch: # WHY: Manual trigger - always available
permissions:
contents: read
env:
PYTHONUNBUFFERED: "1" # WHY: Real-time log output in CI.
PYTHONIOENCODING: "utf-8" # WHY: Consistent encoding across platforms.
PYTHON_VERSION: "3.15"
UV_PYTHON: "3.15"
jobs:
validate:
runs-on: ubuntu-latest
steps:
# ============================================================
# A) ASSEMBLE: Checkout code and set up environment
# ============================================================
- name: A1) Checkout repository code
uses: actions/checkout@v6
# WHY: Required so all subsequent steps can access repo files.
- name: A2) Install uv (with caching)
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
# WHY: Cache the uv tool itself for faster subsequent runs.
cache-dependency-glob: "uv.lock"
# WHY: Invalidate cache only when locked dependencies change.
- name: A3) Install Python ${{ env.PYTHON_VERSION }}
run: uv python install ${{ env.PYTHON_VERSION }}
# WHY: Ensures the pinned Python version is available in CI.
# OBS: Does not modify the repo; uv manages the interpreter locally.
- name: A4) Install all dependencies
run: uv sync --extra dev --extra docs --upgrade
# WHY: Install dev and docs extras so all check and build tools are available.
# OBS: --upgrade ensures CI catches dependency drift early.
- name: A5) Show tool versions
run: |
uv --version
uv run python --version
uv run python -m ruff --version
uv run python -m pyright --version
if [ -f "zensical.toml" ]; then
uv run python -m zensical --version
fi
# WHY: Version output helps debug when tools change.
# ============================================================
# B) BASELINE CHECKS: Repo-specific validation and matrix build
# ============================================================
- name: B1) Run validation
run: uv run python -m se_mapping_education_math_g8 validate
- name: B2) Build coverage matrix
run: uv run python -m se_mapping_education_math_g8 matrix