Skip to content

Commit bf70b75

Browse files
chore: initial commit
0 parents  commit bf70b75

37 files changed

Lines changed: 3191 additions & 0 deletions

‎.cargo/config.toml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[alias]
2+
build-artifacts = "run -p build -- build-artifacts"
3+
4+
[target.x86_64-unknown-linux-gnu]
5+
rustflags = [
6+
# Mold linker
7+
# You may need to install it first.
8+
# "-Clink-arg=-fuse-ld=mold",
9+
10+
# Nightly
11+
# "-Zshare-generics=y",
12+
# "-Zthreads=0",
13+
]
14+
15+
rustdocflags = [
16+
# Mold linker
17+
# "-Clink-arg=-fuse-ld=mold",
18+
]
19+
20+
[target.x86_64-apple-darwin]
21+
rustflags = [
22+
# LLD linker
23+
# The default ld64 linker is often faster on macOS, so this stays disabled.
24+
# "-Clink-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
25+
26+
# Nightly
27+
# "-Zshare-generics=y",
28+
# "-Zthreads=0",
29+
]
30+
31+
[target.aarch64-apple-darwin]
32+
rustflags = [
33+
# LLD linker
34+
# The default ld64 linker is often faster on macOS, so this stays disabled.
35+
# "-Clink-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
36+
37+
# Nightly
38+
# "-Zshare-generics=y",
39+
# "-Zthreads=0",
40+
]
41+
42+
[target.x86_64-pc-windows-msvc]
43+
# LLD linker
44+
linker = "rust-lld.exe"
45+
rustdocflags = ["-Clinker=rust-lld.exe"]
46+
rustflags = [
47+
# Nightly
48+
"-Zshare-generics=n",
49+
"-Zthreads=0",
50+
]
51+
52+
# Optional:
53+
# [profile.dev]
54+
# debug = 1
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Report a reproducible problem in Suon
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Summary
10+
11+
Describe the bug clearly and briefly.
12+
13+
## Steps to reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
## Expected behavior
20+
21+
What did you expect to happen?
22+
23+
## Actual behavior
24+
25+
What happened instead?
26+
27+
## Environment
28+
29+
- OS:
30+
- Rust version:
31+
- Suon version or commit:
32+
33+
## Additional context
34+
35+
Logs, screenshots, traces, and minimal reproduction code are very helpful.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an improvement or new capability for Suon
4+
title: "[Feature] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem
10+
11+
What problem are you trying to solve?
12+
13+
## Proposed solution
14+
15+
Describe the change you would like to see.
16+
17+
## Alternatives considered
18+
19+
Describe any alternatives or workarounds you have considered.
20+
21+
## Additional context
22+
23+
Add links, examples, or design notes here.

‎.github/issue_template/config.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security report
4+
url: mailto:ramonbernardo.contato@gmail.com
5+
about: Report security vulnerabilities privately by email.
6+
- name: Community chat
7+
url: https://discord.com/invite/EKhxe6gjQt
8+
about: Ask questions and discuss ideas with the community.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Summary
2+
3+
Describe the purpose of this pull request and the main change.
4+
5+
## Changes
6+
7+
-
8+
9+
## Testing
10+
11+
- [ ] `cargo fmt --all --check`
12+
- [ ] `cargo clippy --workspace --all-targets -- -D warnings`
13+
- [ ] `cargo test --workspace`
14+
- [ ] `taplo fmt --check --diff`
15+
16+
## Notes
17+
18+
Anything reviewers should pay extra attention to, including tradeoffs or follow-up work.

‎.github/workflows/artifacts.yml‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Builds release binaries and uploads them as CI artifacts.
2+
# Triggered by version tags (v*) or manually via workflow_dispatch.
3+
name: Artifacts
4+
5+
on:
6+
push:
7+
tags:
8+
- "v*"
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
# Required for uploading release artifacts.
17+
contents: write
18+
19+
jobs:
20+
artifacts:
21+
strategy:
22+
matrix:
23+
include:
24+
- os: windows-latest
25+
arch: x64
26+
platform: windows
27+
- os: ubuntu-latest
28+
arch: x64
29+
platform: linux
30+
- os: macos-latest
31+
arch: arm64
32+
platform: macos
33+
name: Build artifacts on ${{ matrix.platform }}-${{ matrix.arch }}
34+
runs-on: ${{ matrix.os }}
35+
timeout-minutes: 30
36+
steps:
37+
- uses: actions/checkout@v6.0.2
38+
- uses: dtolnay/rust-toolchain@nightly
39+
40+
- name: Restore cargo registry and git cache
41+
uses: actions/cache@v5.0.5
42+
with:
43+
path: |
44+
~/.cargo/registry/index/
45+
~/.cargo/registry/cache/
46+
~/.cargo/git/db/
47+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-cargo-registry-
50+
51+
- name: Restore workspace target cache
52+
uses: actions/cache@v5.0.5
53+
with:
54+
path: target
55+
key: ${{ runner.os }}-artifacts-target-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
56+
restore-keys: |
57+
${{ runner.os }}-artifacts-target-
58+
59+
# Uses the custom `tools/build` helper to rename release binaries with
60+
# version, platform, and arch info (e.g. `suon-server-v0.1.0-linux-x64`).
61+
- name: Build named artifacts
62+
run: cargo build-artifacts --release
63+
64+
- name: Upload build artifacts
65+
uses: actions/upload-artifact@v7.0.1
66+
with:
67+
name: suon-${{ matrix.platform }}-${{ matrix.arch }}
68+
path: |
69+
target/release/suon-*
70+
target/release/examples/suon-*
71+
if-no-files-found: error

‎.github/workflows/bench.yml‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Runs criterion benchmarks across the workspace and publishes results to
2+
# GitHub Pages for tracking performance regressions over time.
3+
name: Benchmarks
4+
5+
on:
6+
# Only runs on main branch pushes (not on every PR) because benchmarks
7+
# take longer and are primarily useful for trend analysis.
8+
push:
9+
branches: ["main"]
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
# Required by `github-action-benchmark` to push results to gh-pages.
18+
contents: write
19+
20+
jobs:
21+
bench:
22+
name: Run benchmarks
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 30
25+
steps:
26+
- uses: actions/checkout@v6.0.2
27+
with:
28+
# Full history is needed for benchmark comparison across commits.
29+
fetch-depth: 0
30+
- name: Install Rust nightly
31+
shell: pwsh
32+
run: rustup toolchain install nightly --profile minimal
33+
34+
- name: Restore cargo registry and git cache
35+
uses: actions/cache@v5.0.5
36+
with:
37+
path: |
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-cargo-registry-
44+
45+
- name: Restore workspace target cache
46+
uses: actions/cache@v5.0.5
47+
with:
48+
path: target
49+
key: ${{ runner.os }}-bench-target-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
50+
restore-keys: |
51+
${{ runner.os }}-bench-target-
52+
53+
# Build first without running so the benchmark step is purely measurement.
54+
- name: Build benchmarks
55+
run: cargo bench --workspace --benches --no-run
56+
57+
# `continue-on-error` keeps the workflow alive even if a benchmark fails,
58+
# so previous results are not overwritten by a single broken benchmark.
59+
# `--output-format bencher` produces machine-readable output for the
60+
# benchmark storage action.
61+
- name: Run benchmarks
62+
continue-on-error: true
63+
run: cargo bench --workspace --benches -- --output-format bencher 2>&1 | tee target/benchmarks.txt
64+
65+
- name: Upload criterion HTML reports
66+
uses: actions/upload-artifact@v7.0.1
67+
with:
68+
name: criterion-reports-${{ github.sha }}
69+
path: target/criterion/
70+
if-no-files-found: ignore
71+
72+
# Publishes benchmark results to the `gh-pages` branch so they can be
73+
# viewed as a trend chart over time.
74+
- name: Store benchmark results
75+
uses: benchmark-action/github-action-benchmark@v1.22.0
76+
with:
77+
tool: cargo
78+
output-file-path: target/benchmarks.txt
79+
github-token: ${{ secrets.GITHUB_TOKEN }}
80+
auto-push: true
81+
gh-pages-branch: gh-pages
82+
benchmark-data-dir-path: benchmarks
83+
comment-on-alert: true
84+
# Alert if performance degrades by more than 150% from baseline.
85+
alert-threshold: "150%"
86+
fail-on-alert: false

‎.github/workflows/build.yml‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Verifies that the workspace compiles successfully on three target platforms.
2+
# This is a basic sanity check before running more expensive workflows.
3+
name: Build
4+
5+
on:
6+
push:
7+
pull_request:
8+
branches: [ "main" ]
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
include:
20+
- os: windows-latest
21+
arch: x64
22+
platform: windows
23+
- os: ubuntu-latest
24+
arch: x64
25+
platform: linux
26+
- os: macos-latest
27+
arch: arm64
28+
platform: macos
29+
name: Build on ${{ matrix.arch }}-${{ matrix.platform }}
30+
runs-on: ${{ matrix.os }}
31+
timeout-minutes: 30
32+
steps:
33+
- uses: actions/checkout@v6.0.2
34+
- uses: dtolnay/rust-toolchain@nightly
35+
36+
- name: Restore cargo registry and git cache
37+
uses: actions/cache@v5.0.5
38+
with:
39+
path: |
40+
~/.cargo/registry/index/
41+
~/.cargo/registry/cache/
42+
~/.cargo/git/db/
43+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-cargo-registry-
46+
47+
- name: Restore workspace target cache
48+
uses: actions/cache@v5.0.5
49+
with:
50+
path: target
51+
key: ${{ runner.os }}-workspace-target-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
52+
restore-keys: |
53+
${{ runner.os }}-workspace-target-
54+
55+
- name: Build workspace
56+
run: cargo build --workspace --verbose

‎.github/workflows/deny.yml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Checks crate licenses, dependency bans, and security advisories using
2+
# `cargo-deny`. Runs weekly on a schedule in addition to pull requests.
3+
name: Deny
4+
5+
on:
6+
push:
7+
pull_request:
8+
branches: [ "main" ]
9+
workflow_dispatch:
10+
# Weekly scan to catch newly published security advisories.
11+
schedule:
12+
- cron: "0 8 * * 1"
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
deny:
20+
name: Check licenses, bans, and advisories
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
steps:
24+
- uses: actions/checkout@v6.0.2
25+
26+
- name: Restore cargo registry and git cache
27+
uses: actions/cache@v5.0.5
28+
with:
29+
path: |
30+
~/.cargo/registry/index/
31+
~/.cargo/registry/cache/
32+
~/.cargo/git/db/
33+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-cargo-registry-
36+
37+
# Uses the deny configuration from `deny.toml` at the workspace root.
38+
- uses: EmbarkStudios/cargo-deny-action@v2

0 commit comments

Comments
 (0)