Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Benchmarks

# GitHub-hosted runners are noisy — benches here track the *order of magnitude*
# baseline rather than fail on small regressions. They run on master pushes and
# on demand. PRs intentionally do NOT run benches: they're slow and the noise
# floor would just produce false alarms.

on:
push:
branches: [master, main]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

jobs:
bench:
name: Criterion benches
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Bench builds use the release profile; cache it under its own key
# so it doesn't fight with the test job's debug cache.
key: bench
- name: Run criterion benches (each macro)
run: |
set -euo pipefail
mkdir -p bench-output
for crate in \
ras-jsonrpc-macro \
ras-rest-macro \
ras-file-macro \
ras-jsonrpc-bidirectional-macro
do
echo "::group::$crate"
cargo bench -p "$crate" -- \
--warm-up-time 1 --measurement-time 3 \
| tee "bench-output/$crate.txt"
echo "::endgroup::"
done
- name: Upload bench artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: criterion-results
path: |
bench-output/
target/criterion/
retention-days: 30
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check

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
# Catch hard errors and lint regressions. We don't enforce -D warnings
# workspace-wide yet (legacy code has standing warnings); the CI gate is
# "compiles cleanly + no clippy ERRORS". Tighten later by promoting
# selected lints to deny.
- run: cargo clippy --workspace --all-targets --all-features

test:
name: Test (workspace)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build tests
run: cargo test --workspace --all-features --no-run --locked
- name: Run tests
run: cargo test --workspace --all-features -- --nocapture --test-threads=4

coverage:
name: Coverage report
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
- name: Generate coverage (lcov)
run: cargo llvm-cov --workspace --all-features --lcov --output-path lcov.info
- name: Print summary
run: cargo llvm-cov report --summary-only
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-lcov
path: lcov.info
retention-days: 30
# Optional: enable Codecov upload by adding a CODECOV_TOKEN secret and
# uncommenting. Without the token the run still succeeds and the lcov
# artifact above remains the source of truth.
# - uses: codecov/codecov-action@v4
# with:
# files: lcov.info
# fail_ci_if_error: false
32 changes: 0 additions & 32 deletions .github/workflows/test-coverage.yml

This file was deleted.

Loading
Loading