`cargo-test` cannot share its artifacts with `cargo-build` and vice
versa, plus running `e2e-tests` in release build is enough to find out
potential miscompilation.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
If we impl it for `<'f> Fn(&str) -> Option<Cow<'f, str>> + 'f`, then it would somehow imply it to `'static` when using it in `benches/values.rs` and `benches/others.rs`, thus I decided to simplify it back to only implement it for `'static` string.
Users who wants more flexibility should implement `Values` themselves.
This commit also extracts `benches` as a separate crate in an independent workspace to avoid building criterion and tinytemplate in CI, which makes it much slower as more crates need to be built and criterion actually pulls in clap, and a whole lots of other crates.
In additional to that, it:
- Impl `leon::Values` for `Arc<T>` & `Rc<T>` where T: `Values`
- Enable lto, abort on panic, stripping, set `codege-units` to 1 for `leon/benches`
- Move into closure of criterion benchmark loop to reduce indirections
which also reduce sizes of the closure since the Fns used in `ValuesFn`
are zero-size.
This also means that the compiler can now assumes `no-alias`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Fixed#838
- Add new key `subcrate` for rendering `pkg-url`
- Add new release paths in GitHub, GitLab & SourceForge using key `subcrate` for auto-detection
- Add subcrate detection for GitHub and GitLab
- Add `debug!` when using gh api token in `GhApiClient::new`
- Add subcrate testing to `e2e-tests/subcrate.sh`
- Bump cargo-release to 0.24.9 in e2e-tests/live.sh
to fix test failure on MacOS without libssl installed in `/usr/local/`.
- Optimize GhCrateMeta: Detect subcrate and repo-host in `Data::get_repo_info`
to cache the result and avoid duplicate works, this also makes the code
more ergonomic by removing the need to some `unwrap()` plus making it
more efficient since we don't need to clone the url just to modify it.
- Add instrument to `Data::get_repo_info`
- Fix `shellcheck` err in `e2e-tests/*.sh`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
`leon_macros::template!` can parse template at compile-time.
It accepts a utf-8 string literal and uses `leon` internally to parse it, then generate code that evaluates to `Template<'static>`.
- Exclude fuzz from crate leon when publishing
- Impl fn-like proc-macro `leon_macros::template!`
- Add dep `leon-macros` to binstalk
- Use `leon_macros::template!` in `binstalk::fetchers::gh_crate_meta::hosting`
- Add doc for `leon-macros` in `leon`
- Improve `std::fmt::Display` impl for `leon::ParseError`
- Fixed broken infra link in leon
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Since it is run on PR anyway, we should also run it on main just in case
it fails, i.e. merging of PRs without rebasing against main to test out
latest changes.
It will now also be run on draft PR so that they can test out the
changes and find out bugs before making it ready to review.
This change will also increase cache hits on PR, thus speeding up the CI.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Avoid checking dev-deps for jobs `*-check` and lint in workflow `ci.yml`
We just want to make sure cargo-binstall can compile for the target, we
don't want to pull in the extra dependencies.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Speedup ci.yml: Do not run tests on x86_64-unknown-linux-musl
Since we already run test on x86_64-unknown-linux-musl in
release-build.yml and x86_64-unknown-linux-musl is almost identical to
x86_64-unknown-linux-gnu except for the libc, there's no need to run the
tests in ci.yml
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Since release build enables a lot of optimization, disable debug assert
and possibly change the code to be run, it's better to run the tests
again.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>