Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit a638c3c

Browse files
committed
first commit
0 parents  commit a638c3c

51 files changed

Lines changed: 11940 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[build]
2+
target-dir = "target"
3+
4+
# iOS configuration
5+
[target.aarch64-apple-ios]
6+
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
7+
8+
[target.x86_64-apple-ios]
9+
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
10+
11+
# Android configuration
12+
[target.aarch64-linux-android]
13+
linker = "aarch64-linux-android-clang"
14+
rustflags = ["-C", "link-arg=-lc++_shared"]
15+
16+
[target.armv7-linux-androideabi]
17+
linker = "armv7a-linux-androideabi-clang"
18+
rustflags = ["-C", "link-arg=-lc++_shared"]
19+
20+
[target.i686-linux-android]
21+
linker = "i686-linux-android-clang"
22+
rustflags = ["-C", "link-arg=-lc++_shared"]
23+
24+
[target.x86_64-linux-android]
25+
linker = "x86_64-linux-android-clang"
26+
rustflags = ["-C", "link-arg=-lc++_shared"]
27+
28+
# Windows MSVC
29+
[target.x86_64-pc-windows-msvc]
30+
rustflags = ["-C", "target-feature=+crt-static"]
31+
32+
[target.aarch64-pc-windows-msvc]
33+
rustflags = ["-C", "target-feature=+crt-static"]

.github/workflows/ci.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
test:
15+
name: Test Suite
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
rust: [nightly]
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Rust ${{ matrix.rust }}
25+
uses: dtolnay/rust-toolchain@master
26+
with:
27+
toolchain: ${{ matrix.rust }}
28+
29+
- name: Cache cargo registry
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.cargo/registry
33+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34+
35+
- name: Cache cargo index
36+
uses: actions/cache@v4
37+
with:
38+
path: ~/.cargo/git
39+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
40+
41+
- name: Cache cargo build
42+
uses: actions/cache@v4
43+
with:
44+
path: target
45+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
46+
47+
- name: Run tests
48+
run: cargo test --all-features --verbose
49+
50+
- name: Run tests (no default features)
51+
run: cargo test --no-default-features --verbose
52+
53+
fmt:
54+
name: Formatting
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Install Rust nightly
60+
uses: dtolnay/rust-toolchain@nightly
61+
with:
62+
components: rustfmt
63+
64+
- name: Check formatting
65+
run: cargo fmt -- --check
66+
67+
clippy:
68+
name: Clippy
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Install Rust nightly
74+
uses: dtolnay/rust-toolchain@nightly
75+
with:
76+
components: clippy
77+
78+
- name: Cache cargo registry
79+
uses: actions/cache@v4
80+
with:
81+
path: ~/.cargo/registry
82+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
83+
84+
- name: Run clippy
85+
run: cargo clippy --all-features -- -D warnings
86+
87+
doc:
88+
name: Documentation
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
93+
- name: Install Rust nightly
94+
uses: dtolnay/rust-toolchain@nightly
95+
96+
- name: Cache cargo registry
97+
uses: actions/cache@v4
98+
with:
99+
path: ~/.cargo/registry
100+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
101+
102+
- name: Build documentation
103+
run: cargo doc --no-deps --all-features
104+
env:
105+
RUSTDOCFLAGS: -D warnings
106+
107+
coverage:
108+
name: Code Coverage
109+
runs-on: ubuntu-latest
110+
steps:
111+
- uses: actions/checkout@v4
112+
113+
- name: Install Rust nightly
114+
uses: dtolnay/rust-toolchain@nightly
115+
116+
- name: Install cargo-tarpaulin
117+
run: cargo install cargo-tarpaulin
118+
119+
- name: Generate coverage
120+
run: cargo tarpaulin --all-features --workspace --timeout 120 --out Xml
121+
122+
- name: Upload coverage to Codecov
123+
uses: codecov/codecov-action@v4
124+
with:
125+
files: ./cobertura.xml
126+
fail_ci_if_error: false
127+
128+
security-audit:
129+
name: Security Audit
130+
runs-on: ubuntu-latest
131+
steps:
132+
- uses: actions/checkout@v4
133+
134+
- name: Install Rust nightly
135+
uses: dtolnay/rust-toolchain@nightly
136+
137+
- name: Install cargo-audit
138+
run: cargo install cargo-audit
139+
140+
- name: Run security audit
141+
run: cargo audit
142+
143+
build-cross-platform:
144+
name: Cross-Platform Build Check
145+
runs-on: ubuntu-latest
146+
strategy:
147+
matrix:
148+
target:
149+
- x86_64-unknown-linux-gnu
150+
- aarch64-unknown-linux-gnu
151+
- x86_64-apple-darwin
152+
- aarch64-apple-darwin
153+
- x86_64-pc-windows-msvc
154+
steps:
155+
- uses: actions/checkout@v4
156+
157+
- name: Install Rust nightly
158+
uses: dtolnay/rust-toolchain@nightly
159+
with:
160+
targets: ${{ matrix.target }}
161+
162+
- name: Check build
163+
run: cargo check --target ${{ matrix.target }} --all-features

.github/workflows/publish.yml

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: 'Run dry-run publish (no actual publish)'
11+
required: false
12+
default: 'true'
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
RUST_BACKTRACE: 1
17+
18+
jobs:
19+
validate:
20+
name: Validate Package
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install Rust nightly
26+
uses: dtolnay/rust-toolchain@nightly
27+
with:
28+
components: rustfmt, clippy
29+
30+
- name: Cache cargo registry
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cargo/registry
34+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
35+
36+
- name: Cache cargo index
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.cargo/git
40+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
41+
42+
- name: Cache cargo build
43+
uses: actions/cache@v4
44+
with:
45+
path: target
46+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
47+
48+
- name: Check formatting
49+
run: cargo fmt -- --check
50+
51+
- name: Run clippy
52+
run: cargo clippy -- -D warnings
53+
54+
- name: Run tests
55+
run: cargo test --all-features
56+
57+
- name: Build documentation
58+
run: cargo doc --no-deps --all-features
59+
60+
- name: Validate package
61+
run: cargo package --list
62+
63+
publish-crate:
64+
name: Publish to crates.io
65+
runs-on: ubuntu-latest
66+
needs: validate
67+
if: startsWith(github.ref, 'refs/tags/v')
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Install Rust nightly
72+
uses: dtolnay/rust-toolchain@nightly
73+
74+
- name: Publish to crates.io
75+
env:
76+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
77+
run: |
78+
if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then
79+
echo "Running dry-run publish..."
80+
cargo publish --dry-run
81+
else
82+
echo "Publishing to crates.io..."
83+
cargo publish
84+
fi
85+
86+
build-artifacts:
87+
name: Build Release Artifacts
88+
runs-on: ${{ matrix.os }}
89+
needs: validate
90+
if: startsWith(github.ref, 'refs/tags/v')
91+
strategy:
92+
matrix:
93+
include:
94+
# Linux builds
95+
- os: ubuntu-latest
96+
target: x86_64-unknown-linux-gnu
97+
artifact_name: libnexus_core.so
98+
asset_name: libnexus_core-linux-x86_64.so
99+
100+
# macOS builds
101+
- os: macos-latest
102+
target: aarch64-apple-darwin
103+
artifact_name: libnexus_core.dylib
104+
asset_name: libnexus_core-macos-arm64.dylib
105+
106+
- os: macos-latest
107+
target: x86_64-apple-darwin
108+
artifact_name: libnexus_core.dylib
109+
asset_name: libnexus_core-macos-x86_64.dylib
110+
111+
# Windows builds
112+
- os: windows-latest
113+
target: x86_64-pc-windows-msvc
114+
artifact_name: nexus_core.dll
115+
asset_name: nexus_core-windows-x64.dll
116+
117+
steps:
118+
- uses: actions/checkout@v4
119+
120+
- name: Install Rust nightly
121+
uses: dtolnay/rust-toolchain@nightly
122+
with:
123+
targets: ${{ matrix.target }}
124+
125+
- name: Build release
126+
run: cargo build --release --target ${{ matrix.target }}
127+
128+
- name: Upload artifact
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: ${{ matrix.asset_name }}
132+
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
133+
134+
create-release:
135+
name: Create GitHub Release
136+
runs-on: ubuntu-latest
137+
needs: [publish-crate, build-artifacts]
138+
if: startsWith(github.ref, 'refs/tags/v')
139+
permissions:
140+
contents: write
141+
steps:
142+
- uses: actions/checkout@v4
143+
144+
- name: Download all artifacts
145+
uses: actions/download-artifact@v4
146+
with:
147+
path: artifacts
148+
149+
- name: Extract version from tag
150+
id: get_version
151+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
152+
153+
- name: Extract changelog
154+
id: changelog
155+
run: |
156+
# Extract the latest version's changelog
157+
VERSION=${{ steps.get_version.outputs.VERSION }}
158+
sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$ d' > RELEASE_NOTES.md
159+
cat RELEASE_NOTES.md
160+
161+
- name: Create Release
162+
uses: softprops/action-gh-release@v1
163+
with:
164+
body_path: RELEASE_NOTES.md
165+
files: artifacts/**/*
166+
draft: false
167+
prerelease: false
168+
env:
169+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
170+
171+
publish-docs:
172+
name: Publish Documentation
173+
runs-on: ubuntu-latest
174+
needs: publish-crate
175+
if: startsWith(github.ref, 'refs/tags/v')
176+
steps:
177+
- uses: actions/checkout@v4
178+
179+
- name: Install Rust nightly
180+
uses: dtolnay/rust-toolchain@nightly
181+
182+
- name: Build documentation
183+
run: cargo doc --no-deps --all-features
184+
185+
- name: Add index.html redirect
186+
run: echo '<meta http-equiv="refresh" content="0; url=nexus_core">' > target/doc/index.html
187+
188+
- name: Deploy to GitHub Pages
189+
uses: peaceiris/actions-gh-pages@v3
190+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
191+
with:
192+
github_token: ${{ secrets.GITHUB_TOKEN }}
193+
publish_dir: ./target/doc
194+
cname: nexus-core.example.com # Optional: Replace with your custom domain

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Rust build artifacts
2+
/target/
3+
**/*.rs.bk
4+
Cargo.lock

0 commit comments

Comments
 (0)