Speedup ci: Exclude workspace from macOS SIP and windows defenders (#1899)

* 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>
This commit is contained in:
Jiahao XU 2024-08-25 22:15:41 +10:00 committed by GitHub
parent 9330730a2a
commit 069afedf19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,17 @@ inputs:
runs:
using: composite
steps:
- name: Enable macOS developer mode for better
if: runner.os == 'macOS'
run: sudo spctl developer-mode enable-terminal
shell: bash
- name: Exclude workspace and cargo/rustup home from windows defender
if: runner.os == 'Windows'
run: |
Add-MpPreference -ExclusionPath '${{ github.workspace }}'
shell: pwsh
- name: Add just to tools to install
run: echo "tools=just" >>"$GITHUB_ENV"
shell: bash