Skip to content

Commit 5da3433

Browse files
committed
Update versioning and CI workflows for improved stability and documentation
- Changed the version of the `cachekit` package to `0.1.0-alpha` in both `Cargo.toml` and `Cargo.lock` to reflect the alpha release status. - Updated the documentation URL in `Cargo.toml` for better accessibility. - Refined GitHub Actions workflows by standardizing the checkout action version to `v4` across all jobs, enhancing consistency and reliability. - Introduced a new maintenance workflow for scheduled security audits and smoke tests, ensuring ongoing health checks of the codebase.
1 parent 94a1461 commit 5da3433

7 files changed

Lines changed: 254 additions & 127 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,63 +14,67 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
# Format check
18-
fmt:
19-
name: Format
17+
# Check formatting with rustfmt
18+
formatting:
19+
name: cargo fmt
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v6
23-
- uses: dtolnay/rust-toolchain@stable
23+
# Ensure rustfmt is installed and setup problem matcher
24+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2425
with:
2526
components: rustfmt
26-
- name: Check formatting
27-
run: cargo fmt --all -- --check
27+
- name: Rustfmt Check
28+
uses: actions-rust-lang/rustfmt@v1
2829

2930
# Lint with clippy
3031
clippy:
3132
name: Clippy
3233
runs-on: ubuntu-latest
3334
steps:
3435
- uses: actions/checkout@v6
35-
- uses: dtolnay/rust-toolchain@stable
36+
- uses: actions-rust-lang/setup-rust-toolchain@v1
3637
with:
3738
components: clippy
38-
- uses: Swatinem/rust-cache@v2
3939
- name: Run clippy
4040
run: cargo clippy --all-targets --all-features -- -D warnings
4141

4242
# Build and test on multiple platforms
4343
test:
4444
name: Test (${{ matrix.os }})
4545
runs-on: ${{ matrix.os }}
46+
needs: [formatting, clippy]
4647
strategy:
4748
fail-fast: false
4849
matrix:
4950
os: [ubuntu-latest, macos-latest, windows-latest]
5051
steps:
5152
- uses: actions/checkout@v6
52-
- uses: dtolnay/rust-toolchain@stable
53+
- uses: actions-rust-lang/setup-rust-toolchain@v1
5354
- uses: Swatinem/rust-cache@v2
5455
- name: Build
5556
run: cargo build --verbose
5657
- name: Run tests
57-
run: cargo test --package cachekit --lib --verbose
58+
run: cargo test --all-features --all-targets
5859

5960
# Run tests using Miri (curated subset)
6061
miri:
6162
name: Miri (${{ matrix.os }})
6263
runs-on: ${{ matrix.os }}
64+
needs: test
6365
strategy:
6466
fail-fast: false
6567
matrix:
66-
os: [ ubuntu-latest, macos-latest, windows-latest ]
68+
os: [ubuntu-latest, macos-latest]
6769
steps:
6870
- uses: actions/checkout@v6
71+
- uses: actions-rust-lang/setup-rust-toolchain@v1
72+
with:
73+
toolchain: nightly
74+
components: miri
75+
- uses: Swatinem/rust-cache@v2
6976
- name: Install Miri
70-
run: |
71-
rustup toolchain install nightly --component miri
72-
rustup override set nightly
73-
cargo miri setup
77+
run: cargo miri setup
7478
- name: Test with Miri (core DS + light policies)
7579
run: |
7680
cargo miri test --package cachekit --lib ds:: -- --skip concurrent --skip stress --skip large --skip performance --skip memory
@@ -99,7 +103,7 @@ jobs:
99103
with:
100104
token: ${{ secrets.GITHUB_TOKEN }}
101105

102-
# Benchmarks (only on the master branch)
106+
# Benchmarks (only on the main branch)
103107
bench:
104108
name: Benchmarks
105109
runs-on: ubuntu-latest

.github/workflows/maintenance.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Maintenance
2+
3+
on:
4+
schedule:
5+
- cron: "0 8 * * 1"
6+
workflow_dispatch:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
security-audit:
16+
name: Security Audit
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: rustsec/audit-check@v2
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
latest-stable-smoke:
25+
name: Latest Stable Smoke
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v6
29+
- uses: actions-rust-lang/setup-rust-toolchain@v1
30+
- uses: Swatinem/rust-cache@v2
31+
- name: Build and test
32+
run: cargo test --all-features --all-targets

.github/workflows/release.yml

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,68 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*"
7-
workflow_dispatch:
8-
inputs:
9-
tag:
10-
description: "Tag to release (e.g., v0.1.0)"
11-
required: true
12-
type: string
6+
- "v*.*.*"
7+
8+
env:
9+
CARGO_TERM_COLOR: always
1310

1411
permissions:
1512
contents: write
16-
pages: write
17-
id-token: write
1813

1914
jobs:
20-
release:
21-
name: GitHub Release
15+
validate:
16+
name: Validate Release
2217
runs-on: ubuntu-latest
23-
env:
24-
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
2518
steps:
2619
- uses: actions/checkout@v6
20+
- name: Ensure tag points to main
21+
run: |
22+
git fetch origin main --depth=1
23+
git merge-base --is-ancestor "${GITHUB_SHA}" origin/main
24+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2725
with:
28-
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
29-
- uses: dtolnay/rust-toolchain@stable
26+
components: rustfmt, clippy
3027
- uses: Swatinem/rust-cache@v2
31-
- name: Run benchmarks
32-
run: cargo bench --no-fail-fast
33-
- name: Generate benchmark summary
28+
29+
- name: Format check
30+
run: cargo fmt --check
31+
32+
- name: Clippy
33+
run: cargo clippy --all-targets --all-features -- -D warnings
34+
35+
- name: Tests
36+
run: cargo test --all-features --all-targets
37+
38+
- name: Docs
39+
run: cargo doc --no-deps --all-features
40+
env:
41+
RUSTDOCFLAGS: -Dwarnings
42+
43+
- name: Package verification
3444
run: |
35-
./scripts/update_docs_benchmarks.sh target/criterion docs/benchmarks.md
36-
- name: Package benchmark results
37-
run: tar -czf criterion-results.tar.gz target/criterion
38-
- name: Build docs site with Jekyll
39-
uses: actions/jekyll-build-pages@v1
40-
with:
41-
source: ./docs
42-
destination: ./_site
43-
- name: Upload GitHub Pages artifact
44-
uses: actions/upload-pages-artifact@v3
45-
with:
46-
path: _site
47-
- name: Create release for tag push
48-
if: github.event_name == 'push'
49-
uses: softprops/action-gh-release@v2
50-
with:
51-
generate_release_notes: true
52-
files: criterion-results.tar.gz
45+
cargo package
46+
cargo publish --dry-run
5347
54-
- name: Create release for manual dispatch
55-
if: github.event_name == 'workflow_dispatch'
48+
release:
49+
name: GitHub Release
50+
runs-on: ubuntu-latest
51+
needs: validate
52+
steps:
53+
- uses: actions/checkout@v6
54+
- name: Create GitHub Release
5655
uses: softprops/action-gh-release@v2
5756
with:
58-
tag_name: ${{ inputs.tag }}
5957
generate_release_notes: true
60-
files: criterion-results.tar.gz
6158

62-
deploy:
63-
name: Deploy GitHub Pages
59+
publish:
60+
name: Publish to crates.io
6461
runs-on: ubuntu-latest
65-
needs: release
66-
permissions:
67-
pages: write
68-
id-token: write
69-
environment:
70-
name: github-pages
71-
url: ${{ steps.deployment.outputs.page_url }}
62+
needs: validate
63+
if: ${{ secrets.CARGO_REGISTRY_TOKEN != '' }}
7264
steps:
73-
- name: Deploy to GitHub Pages
74-
id: deployment
75-
uses: actions/deploy-pages@v4
65+
- uses: actions/checkout@v6
66+
- uses: actions-rust-lang/setup-rust-toolchain@v1
67+
- name: Publish crate
68+
env:
69+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
70+
run: cargo publish

.github/workflows/rust-clippy.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "cachekit"
3-
version = "0.1.0"
3+
version = "0.1.0-alpha"
44
edition = "2024"
55
license = "MIT OR Apache-2.0"
66
description = "High-performance, policy-driven cache primitives for Rust systems (FIFO/LRU/ARC) with optional metrics."
77
repository = "https://github.com/OxidizeLabs/cachekit"
8-
documentation = "https://docs.rs/cachekit"
8+
documentation = "https://oxidizelabs.github.io/cachekit/"
99
readme = "README.md"
10-
keywords = ["cache", "lru", "fifo", "arc", "metrics"]
10+
keywords = ["cache", "lru", "fifo", "arc", "cache"]
1111
categories = ["data-structures", "caching"]
1212

1313
[features]

0 commit comments

Comments
 (0)