Skip to content

Commit 7adb636

Browse files
committed
feat: define pure engine contracts and enforce crate boundaries
1 parent 2aba195 commit 7adb636

17 files changed

Lines changed: 1069 additions & 0 deletions

File tree

‎.cargo/config.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --package xtask --"

‎.github/workflows/ci.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Rust CI
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
permissions:
7+
contents: read
8+
concurrency:
9+
group: rust-ci-${{ github.ref }}
10+
cancel-in-progress: true
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: dtolnay/rust-toolchain@stable
17+
- uses: Swatinem/rust-cache@v2
18+
- run: cargo test --workspace --all-features --locked
19+
- run: cargo xtask check-deps
20+
lint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: dtolnay/rust-toolchain@stable
25+
with:
26+
components: rustfmt, clippy
27+
- uses: Swatinem/rust-cache@v2
28+
- run: cargo fmt --all -- --check
29+
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
30+
dependencies:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: dtolnay/rust-toolchain@stable
35+
- uses: taiki-e/install-action@cargo-deny
36+
- run: cargo deny --locked check
37+
core-api:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
- uses: dtolnay/rust-toolchain@stable
44+
- uses: taiki-e/install-action@cargo-semver-checks
45+
- name: Check core compatibility against the PR base
46+
if: github.event_name == 'pull_request'
47+
env:
48+
BASE_REF: ${{ github.event.pull_request.base.sha }}
49+
run: |
50+
if git cat-file -e "$BASE_REF:crates/core/gfa-core/Cargo.toml"; then
51+
cargo semver-checks check-release -p gfa-core --baseline-rev "$BASE_REF"
52+
else
53+
echo "Initial core API: no baseline crate exists yet."
54+
fi

‎.gitignore‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/target/
2+
node_modules/
3+
dist/
4+
*.db
5+
*.db-shm
6+
*.db-wal
7+
.env
8+
.venv/
9+
__pycache__/

‎Cargo.lock‎

Lines changed: 188 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[workspace]
2+
resolver = "2"
3+
members = [
4+
"crates/core/gfa-core",
5+
"xtask",
6+
]
7+
8+
[workspace.package]
9+
version = "0.1.0"
10+
edition = "2021"
11+
license = "GPL-3.0-only"
12+
repository = "https://github.com/CurtisTechSolutions/GamesForAI"
13+
14+
[workspace.dependencies]
15+
gfa-core = { version = "0.1.0", path = "crates/core/gfa-core" }
16+
serde = { version = "1", features = ["derive"] }
17+
serde_json = "1"
18+
schemars = "0.8.22"
19+
thiserror = "2"
20+
21+
[workspace.lints.rust]
22+
unsafe_code = "forbid"
23+
missing_docs = "warn"
24+
25+
[workspace.lints.clippy]
26+
unwrap_used = "deny"
27+
expect_used = "deny"
28+
29+
[profile.release]
30+
lto = "thin"
31+
codegen-units = 1

‎crates/core/gfa-core/Cargo.toml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "gfa-core"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
7+
[dependencies]
8+
serde.workspace = true
9+
serde_json.workspace = true
10+
schemars.workspace = true
11+
thiserror.workspace = true
12+
13+
[lints]
14+
workspace = true

0 commit comments

Comments
 (0)