From 069afedf193484171340cfc4d0d6d056423fc993 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 25 Aug 2024 22:15:41 +1000 Subject: [PATCH] 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> --- .github/actions/just-setup/action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 6ab5176fc..175726091 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -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