Add an off-by-default 'unstable' flag ()

* Add an off-by-default 'unstable' flag

* Remove explicit web framework feature names

Having forgotten that deps and features can't have the same name,
attempts to better document all the features in one place were
misplaced.

* Split up tests on Travis

`cargo test` doesn't allow `--workspace` and `--features`
simultaneously, so we're forced to test each package separately in order
to manually specify features (or in this case, test everything but
unstable)

* Update Travis Config

- Document the state of Cargo workspaces and features
- Update the benchmarks to trickle down the 'unstable' feature
This commit is contained in:
Berwyn Jamesson 2020-07-21 08:04:48 -04:00 committed by GitHub
parent 162a15ca83
commit ad8dc8c4c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View file

@ -9,7 +9,15 @@ jobs:
- |
RUN_CLIPPY=true
rustup component add clippy --toolchain=nightly || RUN_CLIPPY=false
- cargo test --all --all-features
# As of right now, these need to be tested individually becuase `--workspace`
# (which is implied by `workspace = true`) cannot be used with `--features`
# This _may_ be resolved with the `--package` flag, however this requires
# opting in to a `-Z` unstable feature as of time of commit.
#
# Follow https://github.com/rust-lang/cargo/issues/5364 for updates.
- cargo test --manifest-path maud/Cargo.toml --features actix-web,iron,rocket
- cargo test --manifest-path maud_htmlescape/Cargo.toml
- cargo test --manifest-path maud_macros/Cargo.toml
- |
if $RUN_CLIPPY; then
CLIPPY_STATUS=0
@ -18,9 +26,12 @@ jobs:
done
(exit $CLIPPY_STATUS)
fi
- name: "Unstable"
script:
- cargo test --all --all-features
- name: "Benchmarks"
script:
- (cd benchmarks && cargo test --benches)
- (cd benchmarks && cargo test --benches --features unstable)
- name: "Documentation"
script:
- (cd docs && make -j$(nproc))

View file

@ -4,6 +4,9 @@ version = "0.1.2"
authors = ["Chris Wong <lambda.fairy@gmail.com>"]
edition = "2018"
[features]
unstable = ["maud/unstable"]
[dependencies]
maud = { path = "../maud" }
handlebars = "*"

View file

@ -12,8 +12,14 @@ categories = ["template-engine"]
edition = "2018"
[features]
default = []
# Web framework integrations
actix-web = ["actix-web-dep", "futures"]
# Unstable features
unstable = []
[dependencies]
maud_htmlescape = { version = "0.17.0", path = "../maud_htmlescape" }
maud_macros = { version = "0.22.0", path = "../maud_macros" }