Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.13 #41

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
61 changes: 16 additions & 45 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,32 @@
name: 📶 Coverage

on:
push:
branches:
- master
pull_request:

env:
CARGO_TERM_COLOR: always
on: [push]

jobs:
coverage:
name: Code Coverage
lint:
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.2.2
uses: actions/checkout@v4

# Setup Rust nightly
- name: Install Rust
uses: actions-rs/[email protected]
id: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
override: true

# Configure cache for Cargo
- name: Cache Cargo registry, index
uses: actions/[email protected]
id: cache-cargo
with:
path: |
~/.cargo/registry
~/.cargo/bin
~/.cargo/git
key: linux-${{ steps.toolchain.outputs.rustc_hash }}-rust-cov-${{ hashFiles('**/Cargo.lock') }}

# Run tests with all features
- name: Test (cargo test)
uses: actions-rs/[email protected]
with:
command: test
args: "--workspace"
- name: Install Cargo Tarpaulin
run: cargo install cargo-tarpaulin

# Install grcov
- uses: actions-rs/[email protected]
id: coverage
- name: Run tests with coverage
run: cargo tarpaulin --out Lcov --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off'
RUSTDOCFLAGS: ''

# Upload to Codecov.io
- name: Upload to Codecov.io
uses: codecov/[email protected]
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}
files: lcov.info
185 changes: 105 additions & 80 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
# -----------------------------------------------------------------------------
# SerdeYML - A robust Rust library for YAML serialization and deserialization.
# -----------------------------------------------------------------------------

[package]
authors = ["Serde YML Contributors"]
categories = ["encoding", "parser-implementations"]
# General project metadata
name = "serde_yml" # The name of the library
version = "0.0.13" # Version of the crate
authors = ["Serde YML Contributors"] # Library contributors
edition = "2021" # Rust edition being used
rust-version = "1.58.0" # Minimum supported Rust version
license = "MIT OR Apache-2.0" # Dual licensing strategy
description = """
A robust Rust library that simplifies the serialization and deserialization of Rust data structures to and from YAML format using the widely-used Serde framework.
"""
documentation = "https://docs.rs/serde_yml/"
edition = "2021"
exclude = ["/.git/*", "/.github/*", "/.gitignore", "/.vscode/*"]
homepage = "https://serdeyml.com"
keywords = ["yaml", "serde", "serialization"]
license = "MIT OR Apache-2.0"
name = "serde_yml"
readme = "README.md"
repository = "https://github.com/sebastienrousseau/serde_yml"
rust-version = "1.56.0"
version = "0.0.12"
""" # Library description
homepage = "https://serdeyml.com" # Project homepage
documentation = "https://docs.rs/serde_yml/" # Documentation URL
repository = "https://github.com/sebastienrousseau/serde_yml" # Repository URL
readme = "README.md" # Path to the README file

# -----------------------------------------------------------------------------
# Crate Configuration
# -----------------------------------------------------------------------------

# Crates.io categories
categories = [
"encoding",
"parser-implementations",
]

# Keywords for easier discoverability on Crates.io
keywords = [
"yaml",
"serde",
"serialization",
]

# Exclude unnecessary files from the package
exclude = [
"/.git/*", # Exclude version control files
"/.github/*", # Exclude GitHub workflows
"/.gitignore", # Ignore Git ignore file
"/.vscode/*" # Ignore VSCode settings
]

include = [
"/CONTRIBUTING.md",
"/LICENSE-APACHE",
Expand All @@ -28,66 +56,75 @@ include = [
"/tests/**",
]

# [[bench]]
# name = "benchmark"
# harness = false
# path = "benches/criterion.rs"
# -----------------------------------------------------------------------------
# Library Information
# -----------------------------------------------------------------------------

# [profile.bench]
# debug = true
[lib]
name = "serde_yml" # Internal name of the library
path = "src/lib.rs" # Path to the library source
crate-type = ["lib"] # Crate type
required-features = []

# -----------------------------------------------------------------------------
# Features
# -----------------------------------------------------------------------------

[dependencies]
indexmap = "2.2.4"
itoa = "1.0"
libyml = "0.0.5"
memchr = { version = "2", default-features = false }
ryu = "1.0"
serde = { version = "1.0.204" }
[features]
default = [] # No default features enabled

# -----------------------------------------------------------------------------
# Build Dependencies
# -----------------------------------------------------------------------------

[build-dependencies]
# Dependencies for build scripts.
version_check = "0.9.4" # Check the Rust version used to compile the package.
version_check = "0.9.5" # Ensures compatible version

# -----------------------------------------------------------------------------
# Development Dependencies
# -----------------------------------------------------------------------------

[dev-dependencies]
indoc = "2.0.5"
serde = { version = "1.0.204", features = ["derive"] }
serde_derive = "1.0.204"
serde = { version = "1.0.217", features = ["derive"] }
serde_derive = "1.0.217"

[features]
default = []
# -----------------------------------------------------------------------------
# Dependencies
# -----------------------------------------------------------------------------

[lib]
crate-type = ["lib"]
doc-scrape-examples = false
name = "serde_yml"
path = "src/lib.rs"
required-features = []
[dependencies]
indexmap = "2.7.0"
itoa = "1.0.14"
libyml = "0.0.5"
memchr = { version = "2", default-features = false }
ryu = "1.0"
serde = "1.0.217"

# -----------------------------------------------------------------------------
# Documentation Configuration
# -----------------------------------------------------------------------------

[package.metadata.docs.rs]
# Specify arguments for rustdoc to enhance documentation quality.
all-features = true # Build documentation with all features enabled
rustdoc-args = [
"--generate-link-to-definition",
"--cfg", "docsrs",
"--document-private-items",
"--display-warnings"
"--display-warnings",
]
# Build docs with all crate features enabled to cover the entire API.
all-features = true
# Target platform for the docs, ensuring compatibility with common Linux servers.
targets = ["x86_64-unknown-linux-gnu"]
targets = ["x86_64-unknown-linux-gnu"] # Default target platform for the docs

# Linting config
[lints.rust]
# -----------------------------------------------------------------------------
# Linting Configuration
# -----------------------------------------------------------------------------

[lints.rust]
## Warn
# box_pointers = "warn"
missing_copy_implementations = "warn"
missing_docs = "warn"
unstable_features = "warn"
# unused_crate_dependencies = "warn"
unused_extern_crates = "warn"
# unused_results = "warn"

## Allow
bare_trait_objects = "allow"
Expand All @@ -98,7 +135,6 @@ trivial_bounds = "allow"
unsafe_code = "allow"

## Forbid
# missing_docs = "warn"
missing_debug_implementations = "forbid"
non_ascii_idents = "forbid"
unreachable_pub = "forbid"
Expand Down Expand Up @@ -128,6 +164,9 @@ unused_macro_rules = "deny"
unused_qualifications = "deny"
variant_size_differences = "deny"

# -----------------------------------------------------------------------------
# Clippy Configuration
# -----------------------------------------------------------------------------

[package.metadata.clippy]
warn-lints = [
Expand All @@ -137,37 +176,23 @@ warn-lints = [
"clippy::nursery",
]

# -----------------------------------------------------------------------------
# Profiles
# -----------------------------------------------------------------------------

[profile.dev]
codegen-units = 256
debug = true
debug-assertions = true
incremental = true
lto = false
opt-level = 0
overflow-checks = true
panic = 'unwind'
rpath = false
strip = false
codegen-units = 256 # Fast compilation for development
debug = true # Enable debugging symbols
incremental = true # Incremental compilation
opt-level = 0 # No optimizations in development

[profile.release]
codegen-units = 1
debug = false
debug-assertions = false
incremental = false
lto = true
opt-level = "s"
overflow-checks = false
panic = "abort"
rpath = false
strip = "symbols"
codegen-units = 1 # Optimized for performance
debug = false # Disable debug symbols
incremental = false # Disable incremental compilation
lto = true # Link-time optimization
opt-level = "s" # Optimize for size

[profile.test]
codegen-units = 256
debug = true
debug-assertions = true
incremental = true
lto = false
opt-level = 0
overflow-checks = true
rpath = false
strip = false
codegen-units = 256 # Fast compilation for testing
debug = true # Enable debugging symbols
Loading
Loading