-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (142 loc) · 4.58 KB
/
Copy pathci.yml
File metadata and controls
155 lines (142 loc) · 4.58 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: CI
on:
push:
branches: ["main"]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace -- -D warnings
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
dep-graph:
name: Dependency Graph
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Check dependency graph
run: cargo tree --workspace --edges normal | python3 scripts/check_dep_graph.py
doc-sync:
name: Doc-Code Sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check doc-code sync
run: python3 scripts/check_doc_sync.py
primitive-leakage:
name: Type Safety
runs-on: ubuntu-latest
# Advisory: flags bare f64 parameters that should use domain newtypes.
# Existing violations will be fixed as new newtypes are added to 6g-common.
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Check primitive leakage at public API boundaries
run: python3 scripts/check_primitive_leakage.py
baseline-comparison:
name: Level-2 Baseline Comparison (PHY)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run PHY Level-2 baseline comparison tests
run: cargo test -p sixg-phy --features=baseline-comparison
# ── Feature matrix: verify every tier builds cleanly ─────────────────────
matrix-features:
name: Feature matrix (${{ matrix.features }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
features:
- "" # default (core tier — no features)
- "baseline-comparison"
- "plotting"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build with features "${{ matrix.features }}"
run: |
if [ -z "${{ matrix.features }}" ]; then
cargo build --workspace
else
cargo build --workspace --features "${{ matrix.features }}"
fi
- name: Test with features "${{ matrix.features }}"
run: |
if [ -z "${{ matrix.features }}" ]; then
cargo test --workspace
else
cargo test --workspace --features "${{ matrix.features }}"
fi
# ── Docker build (core tier) — publish to ghcr.io on push to main ────────
docker-build:
name: Docker build (core tier)
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build (and push on main)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
final-check:
name: Final Check (format + doc-sync)
runs-on: ubuntu-latest
needs: [test, clippy, fmt, doc-sync, dep-graph, baseline-comparison, matrix-features]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Verify formatting
run: cargo fmt --all -- --check
- name: Verify doc-code sync
run: python3 scripts/check_doc_sync.py