Skip to content

Commit

Permalink
Merge pull request #1387 from pitdicker/merge_0.4.x
Browse files Browse the repository at this point in the history
Merge 0.4.x
  • Loading branch information
pitdicker authored Jan 26, 2024
2 parents 5aaf742 + f6980cf commit 58f1f37
Show file tree
Hide file tree
Showing 29 changed files with 1,502 additions and 475 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
name: codecov

env:
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv
ALL_NON_EXCLUSIVE_FEATURES: --features "default unstable-locales rkyv-64 rkyv-validation serde arbitrary"

on:
push:
branches: [main, 0.4.x]
Expand All @@ -18,7 +23,7 @@ jobs:
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo +nightly llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info
run: cargo +nightly llvm-cov ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --workspace --lcov --doctests --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: lint

env:
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv
ALL_NON_EXCLUSIVE_FEATURES: --features "default unstable-locales rkyv-64 rkyv-validation serde arbitrary"

on:
push:
branches: [main, 0.4.x]
Expand All @@ -19,7 +23,7 @@ jobs:
- run: cargo fmt --check --manifest-path fuzz/Cargo.toml
- run: cargo fmt --check --manifest-path bench/Cargo.toml
- run: |
cargo clippy --all-features --all-targets --color=always \
cargo clippy ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --all-targets --color=always \
-- -D warnings
- run: |
cargo clippy --manifest-path fuzz/Cargo.toml --color=always \
Expand All @@ -35,6 +39,7 @@ jobs:
container:
image: tamasfe/taplo:0.8.0
steps:
- uses: actions/checkout@v4
- run: taplo lint
- run: taplo fmt --check --diff

Expand All @@ -50,8 +55,8 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install cargo-deadlinks
- run: cargo deadlinks -- --all-features
- run: cargo doc --all-features --no-deps
- run: cargo deadlinks -- ${{ env.ALL_NON_EXCLUSIVE_FEATURES }}
- run: cargo doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --no-deps
env:
RUSTDOCFLAGS: -Dwarnings

Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: All Tests and Builds

env:
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv
ALL_NON_EXCLUSIVE_FEATURES: --features "default unstable-locales rkyv-32 rkyv-validation serde arbitrary"

on:
push:
branches: [main, 0.4.x]
Expand All @@ -16,10 +20,10 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-features --color=always -- --color=always
- run: cargo test ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always

# later this may be able to be included with the below
# kept separate for now as the following don't compile on 1.57
# kept separate for now as the following don't compile on 1.60
# * arbitrary (requires 1.63 as of v1.3.0)
rust_msrv:
strategy:
Expand All @@ -30,7 +34,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.57
toolchain: "1.61.0"
- uses: Swatinem/rust-cache@v2
# run --lib and --doc to avoid the long running integration tests
# which are run elsewhere
Expand Down Expand Up @@ -59,8 +63,8 @@ jobs:
- run: cargo check --manifest-path fuzz/Cargo.toml --all-targets
# run --lib and --doc to avoid the long running integration tests
# which are run elsewhere
- run: cargo test --lib --all-features --color=always -- --color=always
- run: cargo test --doc --all-features --color=always -- --color=always
- run: cargo test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
- run: cargo test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always

features_check:
strategy:
Expand All @@ -73,8 +77,8 @@ jobs:
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- run: |
cargo hack check --feature-powerset --optional-deps serde,rkyv \
--skip __internal_bench,iana-time-zone,pure-rust-locales,libc,winapi \
cargo hack check --feature-powerset --optional-deps serde \
--skip __internal_bench,iana-time-zone,pure-rust-locales,libc,winapi,rkyv-16,rkyv-64,rkyv-validation \
--all-targets
# run using `bash` on all platforms for consistent
# line-continuation marks
Expand All @@ -85,6 +89,7 @@ jobs:
- run: cargo test --no-default-features --features=alloc
- run: cargo test --no-default-features --features=unstable-locales
- run: cargo test --no-default-features --features=alloc,unstable-locales
- run: cargo test --no-default-features --features=now

no_std:
strategy:
Expand Down Expand Up @@ -118,8 +123,6 @@ jobs:
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
node-version: "12"
- run: cargo build --target ${{ matrix.target }} --color=always

test_wasm:
Expand All @@ -133,7 +136,7 @@ jobs:
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
- uses: jetli/[email protected]
# The `TZ` and `NOW` variables are used to compare the results inside the WASM environment
# with the host system.
Expand Down Expand Up @@ -181,16 +184,16 @@ jobs:
- uses: actions/checkout@v4
- run: cargo install cross
- uses: Swatinem/rust-cache@v2
- run: cross test --lib --all-features --target i686-unknown-linux-gnu --color=always
- run: cross test --doc --all-features --target i686-unknown-linux-gnu --color=always
- run: cross test --lib --all-features --target i686-unknown-linux-musl --color=always
- run: cross test --doc --all-features --target i686-unknown-linux-musl --color=always
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always

check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly doc --all-features --no-deps
- run: cargo +nightly doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --no-deps
env:
RUSTDOCFLAGS: "-D warnings --cfg docsrs"
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ cff-version: 1.2.0
message: Please cite this crate using these information.

# Version information.
date-released: 2023-09-15
version: 0.4.31
date-released: 2024-01-25
version: 0.4.33

# Project information.
abstract: Date and time library for Rust
Expand Down
18 changes: 14 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,36 @@ readme = "README.md"
license = "MIT OR Apache-2.0"
exclude = ["/ci/*"]
edition = "2021"
rust-version = "1.57.0"
rust-version = "1.61.0"

[lib]
name = "chrono"

[features]
# Don't forget to adjust `ALL_NON_EXCLUSIVE_FEATURES` in CI scripts when adding a feature or an optional dependency.
default = ["clock", "std", "wasmbind"]
alloc = []
libc = []
winapi = ["windows-targets"]
std = ["alloc"]
clock = ["std", "winapi", "iana-time-zone", "android-tzdata"]
clock = ["winapi", "iana-time-zone", "android-tzdata", "now"]
now = ["std"]
oldtime = []
wasmbind = ["wasm-bindgen", "js-sys"]
unstable-locales = ["pure-rust-locales"]
# Note that rkyv-16, rkyv-32, and rkyv-64 are mutually exclusive.
rkyv = ["dep:rkyv", "rkyv/size_32"]
rkyv-16 = ["dep:rkyv", "rkyv?/size_16"]
rkyv-32 = ["dep:rkyv", "rkyv?/size_32"]
rkyv-64 = ["dep:rkyv", "rkyv?/size_64"]
rkyv-validation = ["rkyv?/validation"]
# Features for internal use only:
__internal_bench = []

[dependencies]
serde = { version = "1.0.99", default-features = false, optional = true }
pure-rust-locales = { version = "0.7", optional = true }
rkyv = { version = "0.7", optional = true }
rkyv = { version = "0.7.43", optional = true, default-features = false }
arbitrary = { version = "1.0.0", features = ["derive"], optional = true }

[target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies]
Expand Down Expand Up @@ -58,7 +68,7 @@ bincode = { version = "1.3.0" }
wasm-bindgen-test = "0.3"

[package.metadata.docs.rs]
features = ["arbitrary, rkyv, serde, unstable-locales"]
features = ["arbitrary", "rkyv", "serde", "unstable-locales"]
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Default features:
* `alloc`: Enable features that depend on allocation (primarily string formatting)
* `std`: Enables functionality that depends on the standard library. This is a superset of `alloc`
and adds interoperation with standard library types and traits.
* `clock`: Enables reading the system time (`now`) and local timezone (`Local`).
* `clock`: Enables reading the local timezone (`Local`). This is a superset of `now`.
* `now`: Enables reading the system time (`now`)
* `wasmbind`: Interface with the JS Date API for the `wasm32` target.

Optional features:
Expand All @@ -67,7 +68,7 @@ Optional features:

## Rust version requirements

The Minimum Supported Rust Version (MSRV) is currently **Rust 1.57.0**.
The Minimum Supported Rust Version (MSRV) is currently **Rust 1.61.0**.

The MSRV is explicitly tested in CI. It may be bumped in minor releases, but this is not done
lightly.
Expand Down
Loading

0 comments on commit 58f1f37

Please sign in to comment.