-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (115 loc) · 4.41 KB
/
Copy pathci.yml
File metadata and controls
137 lines (115 loc) · 4.41 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
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
# ------------------------------------------------------------------
# Node smoke test: verifies L1 + L5 round-trip works end-to-end.
# Fast (< 30s), no external deps.
# ------------------------------------------------------------------
node-smoke-test:
name: Node.js smoke test (L1 + L5)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: '20'
- name: Run smoke test
run: node reference/examples/smoke_test.js
# ------------------------------------------------------------------
# Python reference codec: full test suite (L1 + L4 + L5 + Reed-Solomon).
# Matrix on Python 3.10 / 3.11 / 3.12.
# ------------------------------------------------------------------
python-tests:
name: Python reference codec (${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install reference codec
working-directory: reference
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run pytest
working-directory: reference
run: pytest tests/ -v
- name: Run encode demo
working-directory: reference
run: python examples/encode_demo.py
# ------------------------------------------------------------------
# Lint Python with ruff (style) — non-blocking for v0.1, advisory only.
# ------------------------------------------------------------------
python-lint:
name: Python lint (ruff)
runs-on: ubuntu-latest
continue-on-error: true # advisory only at v0.1
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install ruff
run: pip install ruff
- name: Run ruff check
run: ruff check reference/aeonscript/ reference/tests/ reference/examples/
# ------------------------------------------------------------------
# Rust reference codec: builds + runs tests + smoke example.
# The Rust crate is a v0.1 skeleton (L1+L5 implemented, L4 passthrough).
# ------------------------------------------------------------------
rust-tests:
name: Rust reference codec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cargo check
working-directory: reference-rs
run: cargo check --all-targets
- name: Cargo test
working-directory: reference-rs
run: cargo test
- name: Cargo run smoke example
working-directory: reference-rs
run: cargo run --example smoke_test
- name: Cargo fmt --check
working-directory: reference-rs
run: cargo fmt -- --check
continue-on-error: true # advisory at v0.1
- name: Cargo clippy
working-directory: reference-rs
run: cargo clippy --all-targets -- -D warnings
continue-on-error: true # advisory at v0.1
# ------------------------------------------------------------------
# Spec sanity: ensures spec files are valid Markdown and reference the
# right version strings.
# ------------------------------------------------------------------
spec-consistency:
name: Spec / Reference consistency check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check spec version matches code
run: |
set -euo pipefail
spec_version=$(grep -oE 'AeonScript — Specification v[0-9]+\.[0-9]+' spec/SPEC-v*.md | head -1 | grep -oE '[0-9]+\.[0-9]+')
code_version=$(grep -oE '__spec_version__ = "[0-9]+\.[0-9]+"' reference/aeonscript/__init__.py | grep -oE '[0-9]+\.[0-9]+')
echo "Spec declares v$spec_version"
echo "Code declares v$code_version"
if [ "$spec_version" != "$code_version" ]; then
echo "::error::Spec version ($spec_version) does not match code version ($code_version)"
exit 1
fi