diff --git a/.github/workflows/compare_perf.yml b/.github/workflows/compare_perf.yml index e5a2d4f9c928eac2d1b1cf54ed374f8b0cca5d25..a315ce5edd103ba33cf58c9042b77fb55ac85440 100644 --- a/.github/workflows/compare_perf.yml +++ b/.github/workflows/compare_perf.yml @@ -34,6 +34,12 @@ jobs: run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: compare_perf::run_perf::install_hyperfine uses: taiki-e/install-action@hyperfine - name: steps::git_checkout diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13cc3e912ad27797c4e5fbe87f3906200323457c..e7782fac65571dba299390a26e3a23dcca819dc5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,12 @@ jobs: uses: taiki-e/install-action@nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast - name: steps::show_sccache_stats @@ -88,6 +94,12 @@ jobs: uses: taiki-e/install-action@nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 250 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast - name: steps::show_sccache_stats @@ -133,6 +145,16 @@ jobs: - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than.ps1 250 shell: pwsh + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast shell: pwsh @@ -169,6 +191,12 @@ jobs: R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} SCCACHE_BUCKET: sccache-zed + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::clippy run: ./script/clippy - name: steps::show_sccache_stats @@ -204,6 +232,12 @@ jobs: R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} SCCACHE_BUCKET: sccache-zed + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::clippy run: ./script/clippy - name: steps::show_sccache_stats @@ -230,6 +264,16 @@ jobs: R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} SCCACHE_BUCKET: sccache-zed + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: steps::clippy run: ./script/clippy.ps1 shell: pwsh @@ -308,6 +352,12 @@ jobs: run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: ./script/bundle-linux run: ./script/bundle-linux - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz' @@ -348,6 +398,12 @@ jobs: run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: ./script/bundle-linux run: ./script/bundle-linux - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz' @@ -393,6 +449,12 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: run_bundling::bundle_mac::bundle_mac run: ./script/bundle-mac aarch64-apple-darwin - name: '@actions/upload-artifact Zed-aarch64.dmg' @@ -438,6 +500,12 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: run_bundling::bundle_mac::bundle_mac run: ./script/bundle-mac x86_64-apple-darwin - name: '@actions/upload-artifact Zed-x86_64.dmg' @@ -481,6 +549,16 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture aarch64 shell: pwsh @@ -526,6 +604,16 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture x86_64 shell: pwsh diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 916b7078bc79b3dfe691ecf5b2c998e7fa155d50..5645fb987d488854c4f719f2afad45ca50ba1f79 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -53,6 +53,16 @@ jobs: - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than.ps1 250 shell: pwsh + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast shell: pwsh @@ -86,6 +96,16 @@ jobs: R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} SCCACHE_BUCKET: sccache-zed + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: steps::clippy run: ./script/clippy.ps1 shell: pwsh @@ -124,6 +144,12 @@ jobs: run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: ./script/bundle-linux run: ./script/bundle-linux - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz' @@ -170,6 +196,12 @@ jobs: run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: ./script/bundle-linux run: ./script/bundle-linux - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz' @@ -221,6 +253,12 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: run_bundling::bundle_mac::bundle_mac run: ./script/bundle-mac aarch64-apple-darwin - name: '@actions/upload-artifact Zed-aarch64.dmg' @@ -272,6 +310,12 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: run_bundling::bundle_mac::bundle_mac run: ./script/bundle-mac x86_64-apple-darwin - name: '@actions/upload-artifact Zed-x86_64.dmg' @@ -323,6 +367,16 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture aarch64 shell: pwsh @@ -376,6 +430,16 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture x86_64 shell: pwsh diff --git a/.github/workflows/run_bundling.yml b/.github/workflows/run_bundling.yml index 2b536425a1dc4b9663c726fd9259c95e0626efda..dd7435edf2fe015b2808c718cabff66c1fcba96a 100644 --- a/.github/workflows/run_bundling.yml +++ b/.github/workflows/run_bundling.yml @@ -34,6 +34,12 @@ jobs: run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: ./script/bundle-linux run: ./script/bundle-linux - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz' @@ -73,6 +79,12 @@ jobs: run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: ./script/bundle-linux run: ./script/bundle-linux - name: '@actions/upload-artifact zed-linux-x86_64.tar.gz' @@ -117,6 +129,12 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: run_bundling::bundle_mac::bundle_mac run: ./script/bundle-mac aarch64-apple-darwin - name: '@actions/upload-artifact Zed-aarch64.dmg' @@ -161,6 +179,12 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: run_bundling::bundle_mac::bundle_mac run: ./script/bundle-mac x86_64-apple-darwin - name: '@actions/upload-artifact Zed-x86_64.dmg' @@ -203,6 +227,16 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture aarch64 shell: pwsh @@ -247,6 +281,16 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture x86_64 shell: pwsh diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 4279afbcb0751527a37b591e8d3689d85b5b03c1..e218dc64389f883dd2385dec545f72170fce6934 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -162,6 +162,16 @@ jobs: R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} SCCACHE_BUCKET: sccache-zed + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: steps::clippy run: ./script/clippy.ps1 shell: pwsh @@ -201,6 +211,12 @@ jobs: R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} SCCACHE_BUCKET: sccache-zed + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::clippy run: ./script/clippy - name: steps::show_sccache_stats @@ -232,6 +248,12 @@ jobs: R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} SCCACHE_BUCKET: sccache-zed + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::clippy run: ./script/clippy - name: steps::show_sccache_stats @@ -267,6 +289,16 @@ jobs: - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than.ps1 250 shell: pwsh + - name: install_cargo_mtime + run: |- + New-Item -ItemType Directory -Path "target" -Force + Invoke-WebRequest -Uri "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-pc-windows-msvc-v0.1.2.tar.gz" -OutFile "target/cargo-mtime.tar.gz" + tar xzf target/cargo-mtime.tar.gz -C target + Remove-Item target/cargo-mtime.tar.gz + shell: pwsh + - name: run_cargo_mtime + run: ./target/cargo-mtime.exe . target/cargo-mtime.db + shell: pwsh - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }} shell: pwsh @@ -319,6 +351,12 @@ jobs: uses: taiki-e/install-action@nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 250 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-x86_64-unknown-linux-musl-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }} - name: steps::show_sccache_stats @@ -370,6 +408,12 @@ jobs: uses: taiki-e/install-action@nextest - name: steps::clear_target_dir_if_large run: ./script/clear-target-dir-if-larger-than 300 + - name: install_cargo_mtime + run: |- + mkdir -p target + curl -sL "https://github.com/zed-industries/cargo-mtime/releases/download/v0.1.2/cargo-mtime-aarch64-apple-darwin-v0.1.2.tar.gz" | tar xz -C target + - name: run_cargo_mtime + run: ./target/cargo-mtime . target/cargo-mtime.db - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }} - name: steps::show_sccache_stats diff --git a/tooling/xtask/src/tasks/workflows/compare_perf.rs b/tooling/xtask/src/tasks/workflows/compare_perf.rs index 1d111acc4f8a4dc47edea6f45c0b93c845b7cda2..8bc623369b45ff593d0e1b1526e8cbe86be615f1 100644 --- a/tooling/xtask/src/tasks/workflows/compare_perf.rs +++ b/tooling/xtask/src/tasks/workflows/compare_perf.rs @@ -55,6 +55,8 @@ pub fn run_perf( .add_step(steps::checkout_repo()) .add_step(steps::setup_cargo_config(runners::Platform::Linux)) .map(steps::install_linux_dependencies) + .add_step(steps::install_cargo_mtime(runners::Platform::Linux)) + .add_step(steps::run_cargo_mtime(runners::Platform::Linux)) .add_step(install_hyperfine()) .add_step(steps::git_checkout(base)) .add_step(cargo_perf_test(base, crate_name)) diff --git a/tooling/xtask/src/tasks/workflows/run_bundling.rs b/tooling/xtask/src/tasks/workflows/run_bundling.rs index 7fa82e80c52b9e6faec6a377d906269e7a3dbb77..c374ada5de94dc1f56b9c3e188ab5245cb42a568 100644 --- a/tooling/xtask/src/tasks/workflows/run_bundling.rs +++ b/tooling/xtask/src/tasks/workflows/run_bundling.rs @@ -102,6 +102,8 @@ pub(crate) fn bundle_mac( .add_step(steps::setup_node()) .add_step(steps::setup_sentry()) .add_step(steps::clear_target_dir_if_large(runners::Platform::Mac)) + .add_step(steps::install_cargo_mtime(Platform::Mac)) + .add_step(steps::run_cargo_mtime(Platform::Mac)) .add_step(bundle_mac(arch)) .add_step(upload_artifact(&format!( "target/{arch}-apple-darwin/release/{artifact_name}" @@ -152,6 +154,8 @@ pub(crate) fn bundle_linux( }) .add_step(steps::setup_sentry()) .map(steps::install_linux_dependencies) + .add_step(steps::install_cargo_mtime_for_arch(Platform::Linux, arch)) + .add_step(steps::run_cargo_mtime(Platform::Linux)) .add_step(steps::script("./script/bundle-linux")) .add_step(upload_artifact(&format!("target/release/{artifact_name}"))) .add_step(upload_artifact(&format!( @@ -191,6 +195,8 @@ pub(crate) fn bundle_windows( job.add_step(set_release_channel(platform, release_channel)) }) .add_step(steps::setup_sentry()) + .add_step(steps::install_cargo_mtime(Platform::Windows)) + .add_step(steps::run_cargo_mtime(Platform::Windows)) .add_step(bundle_windows(arch)) .add_step(upload_artifact(&format!("target/{artifact_name}"))) .add_step(upload_artifact(&format!( diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs index 49c4488dc95620c00a6a8f929cfb756d9c4eb6fa..fc71bbf6b5ec062e837d5efc25caea017ba7a6a7 100644 --- a/tooling/xtask/src/tasks/workflows/run_tests.rs +++ b/tooling/xtask/src/tasks/workflows/run_tests.rs @@ -374,6 +374,8 @@ pub(crate) fn clippy(platform: Platform) -> NamedJob { steps::install_linux_dependencies, ) .add_step(steps::setup_sccache(platform)) + .add_step(steps::install_cargo_mtime(platform)) + .add_step(steps::run_cargo_mtime(platform)) .add_step(steps::clippy(platform)) .add_step(steps::show_sccache_stats(platform)), } @@ -428,6 +430,8 @@ fn run_platform_tests_impl(platform: Platform, filter_packages: bool) -> NamedJo |job| job.add_step(steps::cargo_install_nextest()), ) .add_step(steps::clear_target_dir_if_large(platform)) + .add_step(steps::install_cargo_mtime(platform)) + .add_step(steps::run_cargo_mtime(platform)) .when(filter_packages, |job| { job.add_step( steps::cargo_nextest(platform).with_changed_packages_filter("orchestrate"), diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs index ff0b73b805fcbb83d1f81c303bd4301c0ead6c78..7c31aec65653e1f9258b60af2a95bbe748335a22 100644 --- a/tooling/xtask/src/tasks/workflows/steps.rs +++ b/tooling/xtask/src/tasks/workflows/steps.rs @@ -1,8 +1,13 @@ use gh_workflow::*; -use crate::tasks::workflows::{runners::Platform, vars, vars::StepOutput}; +use crate::tasks::workflows::{ + runners::{Arch, Platform}, + vars, + vars::StepOutput, +}; const SCCACHE_R2_BUCKET: &str = "sccache-zed"; +const CARGO_MTIME_VERSION: &str = "v0.1.2"; const BASH_SHELL: &str = "bash -euxo pipefail {0}"; // https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsshell @@ -157,6 +162,62 @@ pub fn cache_rust_dependencies_namespace() -> Step { .add_with(("path", "~/.rustup")) } +fn cargo_mtime_target(platform: Platform, arch: Arch) -> &'static str { + match (platform, arch) { + (Platform::Linux, Arch::X86_64) => "x86_64-unknown-linux-musl", + (Platform::Linux, Arch::AARCH64) => "aarch64-unknown-linux-musl", + (Platform::Mac, Arch::X86_64) => "x86_64-apple-darwin", + (Platform::Mac, Arch::AARCH64) => "aarch64-apple-darwin", + (Platform::Windows, Arch::X86_64) => "x86_64-pc-windows-msvc", + (Platform::Windows, Arch::AARCH64) => "aarch64-pc-windows-msvc", + } +} + +fn default_runner_arch(platform: Platform) -> Arch { + match platform { + Platform::Linux => Arch::X86_64, + Platform::Mac => Arch::AARCH64, + Platform::Windows => Arch::X86_64, + } +} + +pub fn install_cargo_mtime(platform: Platform) -> Step { + install_cargo_mtime_for_arch(platform, default_runner_arch(platform)) +} + +pub fn install_cargo_mtime_for_arch(platform: Platform, arch: Arch) -> Step { + let target = cargo_mtime_target(platform, arch); + let url = format!( + "https://github.com/zed-industries/cargo-mtime/releases/download/{}/cargo-mtime-{}-{}.tar.gz", + CARGO_MTIME_VERSION, target, CARGO_MTIME_VERSION + ); + match platform { + Platform::Windows => Step::new("install_cargo_mtime") + .run(format!( + "New-Item -ItemType Directory -Path \"target\" -Force\n\ + Invoke-WebRequest -Uri \"{url}\" -OutFile \"target/cargo-mtime.tar.gz\"\n\ + tar xzf target/cargo-mtime.tar.gz -C target\n\ + Remove-Item target/cargo-mtime.tar.gz" + )) + .shell(PWSH_SHELL), + Platform::Linux | Platform::Mac => Step::new("install_cargo_mtime").run(format!( + "mkdir -p target\n\ + curl -sL \"{url}\" | tar xz -C target" + )), + } +} + +pub fn run_cargo_mtime(platform: Platform) -> Step { + match platform { + Platform::Windows => Step::new("run_cargo_mtime") + .run("./target/cargo-mtime.exe . target/cargo-mtime.db") + .shell(PWSH_SHELL), + Platform::Linux | Platform::Mac => { + Step::new("run_cargo_mtime").run("./target/cargo-mtime . target/cargo-mtime.db") + } + } +} + pub fn setup_sccache(platform: Platform) -> Step { let step = match platform { Platform::Windows => named::pwsh("./script/setup-sccache.ps1"),