* Enable macOS dev mode in CI
to speedup CI
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Enable dev drive on windows to speedup CI
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Use dev drive for target
which is the most write-heavy part.
The read to the workspace can be cached as it is really small
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Setup dev drive for cargo/rust home
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Exclude target, cargo/rustup home from windows defender
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Exclude the entire workspace from
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix action.yml
Add missing shell, and merge steps for adding windows defender exclusion
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix adding windows defender exclusion path
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix use of Add-MpPreference
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix pwsh
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix creating second dev drive
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix second dev drive setup
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Fix caching: Do not mount dev drive at target
Since it contains files that are not accessible.
Also remove use of dev drive for cargo/rustup home since it prevents caching (rust-cache does not read from env).
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Disable dev drive for windows as a failed experiment
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
---------
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Update gh-action.yml
Use CI_RELEASE_TEST_GITHUB_TOKEN if found as that one has less power
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Update install-script.yml
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* RM outdated comment in gh-action.yml
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Pass github token to cargo-bins/cargo-binstall action in release-cli.yml
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Pass github-token to taiki-e/install-action in release-pr.yml
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
---------
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* 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>
* 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>
* 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
* 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>
* 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>
* Use secrets,CI_TEST_GITHUB_TOKEN for testing in ci.yml
* Run e2e-test in release-packages.yml using secrets.CI_TEST_GITHUB_TOKEN
* Use CI_RELEASE_TEST_GITHUB_TOKEN in e2e-test in release-packages.yml
* Refactor: Mv leon and leon-macros into another repo
It's moved to https://github.com/cargo-bins/leon
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix CI: Rm `cargo-hack` check for `leon`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* CI: Use runner `macos-14` which uses M1 machine
`macos-14` provides 3-core M1, 7G mem and 14G stroage, while `macos-latest`
(`macos-13` as of writing) provides 4-core intel, 14G mem and 14G
storage.
While the memory is cut by half and core count reduce by 1, I believe
that it would still speedup the CI since M1 is much more powerful than
previous Intel CPU used in `macos-13`.
It would also allow us to run tests on aarch64-apple-darwin and on
universal-apple-darwin, if necessary.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* CI: Fix `e2e-test-subcrate`: Bump `cargo-audit` ver to v0.18.3
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix detect-targets on android targets
By enabling linux fallback on Android.
Also add CI regression test for aarch64-linux-android target.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix CI: Add job `detect-targets-android-check` as required for merging
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix CI: Dry-run `cargo-publish` on crate to be published
If there's no crate to publish, do not dry-run `cargo-publish`.
Only dry-run `cargo-publish` on crate to be published to avoid
`cargo-publish` error on `cargo-binstall` when one of its direct
dependencies is bumped.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix passing of crate to `release-cli.yml`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix passing of `needs.pr-info.outpus.crate`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix `release-dry-run`: Only run if is release or is not PR event
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix passing of crate
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Rm `just-setup` from `release-cli.yml` since it cannot be cached
release is trigged by the closing of PR, so the cache is saved under the
branch `release/*` which cannot be reused.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix dry-run publish
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix `release-cli.yml`: Do not dry run `cargo-publish`
If dependencies of `carog-binstall` is bumped, then `cargo-publish` dry
run will fail since the dependency has not published yet
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Speedup step publish in `release-cli.yml`
Use `just-setup` to cache rust/zig compilation, also
disable all features to reduce dependencies pulled in.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* `release-cli.yml`: Restore rust cache before ephermal-crate.sh is run
which writes the key to `Cargo.toml` and invalidates the cache.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* CI: Cache zig global_cache to speedup build
This can be helpful in two situations:
- If `cc` is bumped to a new release, then all the `*-sys` crates will
be rebuilt even if their source doesn't change.
Caching zig global_cache would avoid expensive rebuilds.
- For target `x86_64h-apple-darwin`, it uses build-std which means the
rust cache is quite ineffective (only build-dependencies are cached),
so we would also need zig global_cache to avoid rebuilding c
dependencies in CI.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix missing `shell: bash`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix CI: Create symlink to `zig`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* CI: Fix getting output from prev step in just-setup
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* CI: Include job_id `github.job` in zig cache key
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix ci: Install deps before caching and include `JUST*` env values in caching key
To make sure caching is done properly and does not accidentally include
(old) pre-built binaries that we don't want.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix missing `shell`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix justfile target `check`: Call `cargo hack check` directly
without using the `CARGO=cargo-zigbuild` env since `leon` does not use
external C/C++ compiler anyway.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* CI: Dowgrade cargo-hack to 0.6.10
This is the last version working
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>