* Speedup Linux CI
Use transparent huge page, according to https://kobzol.github.io/rust/rustc/2023/10/21/make-rust-compiler-5percent-faster.html it gives a nice 5% speedup
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix action.yml
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add new dep zeroize
* Use Zeroizing to avoid leaking the token
* Optimize gh-auth-token
Spawn it as a task, and only await it
when using GhApiClient
* Fix binstalk-git-repo-api unit tests
* Speedup compilation on windows
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Speedup CI on macOS
Use lld
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix publish in release-cli.yml
Using latest stable rust
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix publish in release.yml
Use latest stable rust
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Run release-dry-run in merge queue only
Running it twice on PR pipeline and merge queue pipeline only wastes time and causes rate limit.
For PR that modifies release-dry-run and wants to test it, they can temporarily run release-dry-run on PR pipeline.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Bump msrv of binstalk-downloader, binstalk and cargo-binstall to 1.79
* Update From<io::Error> for DownloadError
to use io::Error::downcast
* Update From<io::Error> for BinstallError
* fix dmt
* Use binary name when searching for artifacts
When there is a single binary declared in the manifest and
it differs from the package name, add it to the list of handles
used for pre-built artifact fetching.
* Simplify `binary_name` assignment with a `match`
* Add e2e test
* Only attempt to use the binary name with `GhCrateMeta` fetcher
* Avoid too much over-allocating.
Technically it should also check if gh-crate-meta resolver is enabled, but it is unlikely for it to be disabled and overallocating for extra n-target should be fine, it is an improvement over doubling the space allocated if the binary_name is Some.
* Fix fmt in crates/binstalk/src/ops/resolve.rs
---------
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add cargo-binstall installation path to GITHUB_PATH in install-from-binstall-release.sh
Fixed#1714
* Add cargo-binstall installation path to GITHUB_PATH in install-from-binstall-release.ps1
* Update install-script.yml to test
* Fix use of env var in install-from-binstall-release.ps1
* Log the gh-auth token retrieval failure on debug level
Fixed#1733
* Make gh_token::get an async function
* Improve returned err msg in gh_token::get
* Update use of gh_token::get() in entry.rs
* Fix typos
* Fix unclosed ()
* Fix unclosed ()
* Fix gh_token.rs
* Fix entry.rs
* Fix fmt in entry.rs
* Fix fmt in gh_token.rs
* Fix fmt in gh_token.rs
* Fix fmt in gh_token.rs
* Fix fmt in entry.rs
* Fix job changed-file in ci.yml
* Do not run job e2e-tests on PR
which might not have access to GitHub Token in secrets, if opened by non-maintainer
* Provide GITHUB_TOKEN fallback if the secrets is not accessible
* Fix regex expression passed to sed
* Run e2e-test on x86_64h-apple-darwin
Since it is a target built with `build-std`, we need to make sure it is
runnable.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix `upgrade-transitive-deps`
Fill in PR description, so that reviewer can just re-open it to run the CI.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix job `changed-files`
Convert `ALL_CHANGED_FILES` to multiple lines before processing
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Run e2e-tests and unit-tests on aarch64-apple-darwin
Since the CI now uses M1 instead of x86_64, built a native executable
instead of relying on rosetta
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Run unit-tests on Linux-only
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Share `remote::Client` between tests when in cargo-test
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Run rate-limited binstalk-git-repo-api test in serial
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Update client-side rate limit to 1 request per 300ms
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Reduce test cases in `rate_limited_test_has_release_artifact_and_download_artifacts`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add `cargo-nextest` that I forgot
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix unit testing: Pass auth-token to restful API
to avoid rate limit
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix job changed-files in ci.yml
When there are multiple crates, it would be in multiple lines, breaking github output
* Fix job changed-files in ci.yml
When no crate is changed, command cut will fail.
* Fix job unit-tests in ci.yml
If noo crate is changed, do not run cargo-nextest.
* Fix ci.yml syntax
* Fix unit test for `GhApiClient`
Set client-side rate limit to 1 request per 200 ms
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Only run `detect-targets` test if changed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Only run unit tests for crates that are changed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix job `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix job `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix shell error in job `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* FIx separator for `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix passning of craetes to run
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix passing of `CARGO_NEXTEST_ADDITIONAL_ARGS`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix deciding which crates to test on windows
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix just recipe `unit-tests`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Split test into two jobs
so that they will have they own cache (since different feature flags are used).
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Optimize binstalk-git-repo-api
Use a dedicated github token in CI
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Speedup CI using `cargo-nextest`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix release profile override on Windows
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Optimize unit test in binstalk-registry
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Use `secrets.CI_RELEASE_TEST_GITHUB_TOKEN` for just-setup
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix unit testing in justfile
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add retry on rate limit in unit testing
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Only use `CI_UNIT_TEST_GITHUB_TOKEN` in unit testing
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix `test_get_repo_info`: Retry on rate limit
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix `test_has_release_artifact_and_download_artifacts`
Retry on rate limit
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>