perf: Refactor the Trie
and TrieNode
structs to replace the 2 vec…
#22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
clippy: | |
name: 📎 fmt and clippy | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
rustup update | |
rustup toolchain install nightly | |
rustup default nightly | |
rustup component add clippy rustfmt | |
- run: cargo fmt -- --check | |
- run: cargo clippy --all --all-targets --all-features | |
test: | |
name: 🧪 Tests | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cargo build --all-features | |
- run: cargo doc | |
- run: cargo test --all-features | |
env: | |
RUST_BACKTRACE: 1 | |
cov: | |
name: ☂️ Coverage | |
runs-on: ubuntu-latest | |
container: | |
image: xd009642/tarpaulin:develop-nightly | |
options: --security-opt seccomp=unconfined | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate code coverage | |
run: cargo tarpaulin -p ptrie --doc --tests --out xml --all-features | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false | |
token: ${{secrets.CODECOV_TOKEN}} | |
benchmark: | |
name: ⏱️ Benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
rustup update | |
rustup toolchain install nightly | |
rustup default nightly | |
rustup component add clippy rustfmt | |
- name: Run benchmarks | |
run: cargo bench | |
- name: Checkout previous commit | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.before }} | |
- name: Run benchmarks on previous commit | |
run: cargo bench | |
- name: Save benchmark result of previous commit | |
uses: actions/upload-artifact@v4 | |
with: | |
name: benchmark | |
path: target/criterion/ |