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
28 changes: 28 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# The pull request's title should be fulfilled the following pattern:
#
# <type>[optional scope]: <description>
#
# ... where valid types and scopes can be found below; for example:
#
# build(maven): One level down for native profile
#
# More about configurations on https://github.com/Ezard/semantic-prs#configuration

enabled: true

titleOnly: true

types:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert

targetUrl: https://github.com/leiysky/atrium/blob/main/.github/semantic.yml
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI
on:
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: Run test
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: nextest,cargo-nextest
- run: cargo x test
env:
USE_TLS: 1

required:
name: Required
runs-on: ubuntu-24.04
timeout-minutes: 10
if: ${{ always() }}
needs:
- test
steps:
- name: Guardian
run: |
if [[ ! ( \
"${{ needs.test.result }}" == "success" \
) ]]; then
echo "Required jobs haven't been completed successfully."
exit -1
fi
25 changes: 25 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Merge CI
on:
push:
branches: [ main ]

jobs:
check:
name: Check
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: typos-cli,taplo-cli
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Describe
run: |
cargo x --version
cargo --version
rustc --version
- uses: pre-commit/action@v3.0.1
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
default_install_hook_types: [pre-push]
repos:
- repo: local
hooks:
- id: lint
name: lint
language: system
pass_filenames: false
entry: cargo x lint
- id: lockfile
name: lockfile
language: system
pass_filenames: false
entry: cargo update -w --locked
14 changes: 14 additions & 0 deletions atrium-core/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,17 @@ impl FoyerEngine {
self.inner.remove(key);
}
}

#[cfg(test)]
mod tests {
use foyer::CacheBuilder;

use super::*;

#[test]
fn test_get() {
let engine = FoyerEngine::new(CacheBuilder::new(1024).build());
engine.put(b"foo", b"bar");
assert_eq!(engine.get(b"foo"), Some(b"bar".to_vec()));
}
}
Loading