Run `cargo-publish` without `--no-verify` to verify the publish is valid
and does not depend on unpublished crates in job tag of workflow
`release.yml`, which could be caused by incorrect merge order.
Also enabled `check-semver` to `cargo-bins/release-pr@v2` and install
`cargo-semver-checks` using `taiki-e/install-action@v2` in
job make-release-pr of workflow `release-pr.yml`, since
`release-pr` would try to use `cargo-binstall` for installing
`cargo-semver-checks` used in `check-semver`, but we did not explicitly
require `taiki-e/install-actions@v2` to install `cargo-binstall`, so
`release-pr` could fallback to `cargo-install` which is just too slow.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
- ci: Check feat powerset of leon & binstalk-downloader in `ci.yml`
- fix leon feature `cli`: Enable dep `miette` in feature `cli`
- fix binstalk-downloader when default feature is disabled and no other
tls related feature is enabled (breaking change due to replace of
`tls::Version` with newtype `TLSVersion`).
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
- Remove trigger on "auto merge" enablement, which is just annoying now with the merge queue and was only ever an additional workaround for the release PRs.
- Always run the PR CIs, don't ignore markdown files. That made it impossible to merge PRs that only touched those files (without bypassing requirements).
for upgrading transitive dependencies.
While dependabot is great, it opens one PR for each of these transitive
dependencies, which makes merging harder:
- have to approve every PR
- have to click merge when ci is done
it also creates merge queue runs and commits to main, thus creates a lot
of unused caches and unnecessary CI runs.
This PR creates `upgrade-transitive-deps.yml` that creates one PR for
all transitive change per-day.
It also configures dependabot to only `increase-if-necessary`, same as
library crates.
Since we have several library crates in our workspace, this would mean
that we would have less unnecessary deps bump on these library crates.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Fixed#1038
sccache is not very effective at caching dependencies, the external
C/C++ is recompiled in every ci and it takes a lot of time.
Compilation of other Rust dependencies also takes quite some time and
sccache is not helping at all, so I decided to switch to
`Swatinem/rust-cache@v2`.
The downside of the new caching method is that a new cache conntaining
part of the `.cargo/` and `target/` will be created whenver
`Cargo.lock`/`Cargo.toml` changes, but it can still reuse the old cache
to create new caching.
This is acceptable given that `sccache` often fails to reuse
cache due to rate limiting from GHA, since it is not designed for use
like a s3 object pool, and `sccache` will create a lot of new cache
artifacts for a given branch that cannot be reused in main and would
have to cleanup via a cronjob.
Edit:
rust 1.70 uses llvm 16.0, however ubuntu-latest still uses llvm 15.0
As such, during release-build, cross-lang-lto failed due to llvm is too
old.
Temporarily disable linker-plugin-lto to fix this.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
`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>
`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>
Remove `mozilla-actions/sccache-action@v0.0.2` and instead use `taiki-ie/install-action` to install `sccache`, since we already use `taiki-e/install-action` for installing crates.
This PR also refactor just-setup.yml and use pass `GITHUB_TOKEN` to `taiki-e/install-action` which uses `cargo-binstall` for installing `cargo-auditable` and `sccache`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
since cache-cleanup will issue a lot of gh api requests, running the
workflow right after the PRs would cause the GH API to rate limit all
workflows (including our CI for testing and release) that they can no
longer upload artifacts and `cargo-binstall` would have to fallback to
sending GET requests instead of using GH API, which makes it a lot
slower and more likely to fail.
This PR changes it to be run at 3am and 4:30am AEST which nobody would submit
any PR at that time and then remove all caches of the top 20 closed prs.
The workflow can also now be triggered manually.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Previously it only removes 30 caches for the PR because gh actions-cache list defaults to only listing 30 cache entries.
In this PR, I changed the limit to the maximum allowed 100 cache entries and I also added a loop to keep getting the next 100 cache entries until there is none.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* leon: first implementation
* Update crates/leon/src/values.rs
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Workaround orphan rules to make API more intuitive
* Fmt
* Clippy
* Use CoW
* Use cow for items too
* Test that const construction works
* leon: Initial attempt at O(n) parser
* leon: finish parser (except escapes)
* leon: Improve ergonomics of compile-time templates
* Document helpers
* leon: Docs tweaks
* leon: Use macro to minimise parser tests
* leon: add escapes to parser
* leon: test escapes preceding keys
* leon: add multibyte tests
* leon: test escapes following keys
* Format
* Debug
* leon: Don't actually need to keep track of the key
* leon: Parse to vec first
* leon: there's actually no need for string cows
* leon: reorganise and redo macro now that there's no coww
* Well that was silly
* leon: Adjust text end when pushing
* leon: catch unbalanced keys
* Add error tests
* leon: Catch unfinished escape
* Comment out debugging
* leon: fuzz
* Clippy
* leon: Box parse error
* leon: &dyn instead of impl
* Can't impl FromStr, so rename to parse
* Add Vec<> to values
* leon: Add benches for ways to supply values
* leon: Add bench comparing to std and tt
* Fix fuzz
* Fmt
* Split ParseError and RenderError
* Make miette optional
* Remove RenderError lifetime
* Simplify ParseError type schema
* Write concrete Values types instead of generics
* Add license files
* Reduce criterion deps
* Make default a cow
* Add a CLI leon tool
* Fix tests
* Clippy
* Disable cli by default
* Avoid failing the build when cli is off
* Add to ci
* Update crates/leon/src/main.rs
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Update crates/leon/Cargo.toml
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Bump version
* Error not transparent
* Diagnostic can do forwarding
* Simplify error type
* Expand doc examples
* Generic Values for Hash and BTree maps
* One more borrowed
* Forward implementations
* More generics
* Add has_keys
* Lock stdout in leon tool
* No more debug comments in parser
* Even more generics
* Macros to reduce bench duplication
* Further simplify error
* Fix leon main
* Stable support
* Clippy
---------
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
to make the pre-built artifacts auditable by `cargo-audit` and other
tools.
* Add new env `JUST_USE_AUDITABLE` to enable use of `cargo-auditable`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
- Remove `tools: cross` input to `actions/just-setup`
since we use `cargo-zigbuild` for cross compiling instead of `cross-rs`
now.
- Only install `cargo-zigbuild` in `just ci-install-deps` if `JUST_USE_CARGO_ZIGBUILD` is enabled
- Include hash of `rustc -vV` in `build-cache`
Switching between different versions of `rustc` will cause all crates to be
rebuilt using new `rustc`.
- Replace input `cache` with `index-cache` and `build-cache` in `actions/just-setup`
for better control of caching behavior
- Reuse workflow `test`'s `build-cache` in workflow `lint`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Fixed#776
- Add new feature gh-api-client to binstalk-downloader
- Impl new type `binstalk_downloader::remote::{RequestBuilder, Response}`
- Impl `binstalk_downloader::gh_api_client::GhApiClient`, exposed if `cfg(feature = "gh-api-client")` and add e2e and unit tests for it
- Use `binstalk_downloader::gh_api_client::GhApiClient` to speedup `cargo-binstall`
- Add new option `--github-token` to supply the token for GitHub restful API, or read from env variable `GITHUB_TOKEN` if not present.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Run e2e-tests for release build
* Print `RUSTFLAGS` for justfile target build & check
* Fix CI: Disable miropt level 4
* Fix CI: Disable -Zbuild-std
* Disable `-Zgcc-ld=lld` and `-Zshare-generics` so that we can switch back to stable
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Fixed#779#791
- Retry request on timeout
- Retry for `StatusCode::{REQUEST_TIMEOUT, GATEWAY_TIMEOUT}`
- Add `DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT` for 503/429
if 503/429 does not give us a header or give us an invalid header on
when to retry, we would default to
`DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT`.
- Fix `Client::get_redirected_final_url`: Retry using `GET` on status code 400..405 + 410
- Rename remote_exists => remote_gettable & support fallback to GET
if HEAD fails due to status code 400..405 + 410.
- Improve `Client::get_stream`: Include url & method in the err of the stream returned
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>