diff --git a/.github/actions/check_style/action.yml b/.github/actions/check_style/action.yml index e95c6b493af4faf2f35f51eb2d421ed06da8cd7a..22c7380143259571fd387324c11e22f1210dc349 100644 --- a/.github/actions/check_style/action.yml +++ b/.github/actions/check_style/action.yml @@ -8,15 +8,6 @@ runs: shell: bash -euxo pipefail {0} run: cargo fmt --all -- --check - - name: cargo clippy - shell: bash -euxo pipefail {0} - # clippy.toml is not currently supporting specifying allowed lints - # so specify those here, and disable the rest until Zed's workspace - # will have more fixes & suppression for the standard lint set - run: | - cargo clippy --release --workspace --all-features --all-targets -- -A clippy::all -D clippy::dbg_macro -D clippy::todo - cargo clippy -p gpui - - name: Find modified migrations shell: bash -euxo pipefail {0} run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7bde60eec3b3999b9062e53c70280fefbeabc18..61c0d50296549bd0177cac48a4744a248a2d7ecb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ env: jobs: style: - name: Check formatting, Clippy lints, and spelling + name: Check formatting and spelling runs-on: - self-hosted - test @@ -59,8 +59,8 @@ jobs: input: "crates/rpc/proto/" against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,subdir=crates/rpc/proto/" - tests: - name: Run tests + macos_tests: + name: (macOS) Run Clippy and tests runs-on: - self-hosted - test @@ -71,6 +71,10 @@ jobs: clean: false submodules: "recursive" + - name: cargo clippy + shell: bash -euxo pipefail {0} + run: script/clippy + - name: Run tests uses: ./.github/actions/run_tests @@ -80,13 +84,46 @@ jobs: - name: Build other binaries run: cargo build --workspace --bins --all-features + # todo!(linux): Actually run the tests + linux_tests: + name: (Linux) Run Clippy and tests + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + clean: false + submodules: "recursive" + + - name: Restore from cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + + - name: configure linux + shell: bash -euxo pipefail {0} + run: script/linux + + - name: cargo clippy + shell: bash -euxo pipefail {0} + run: script/clippy + + - name: Build Zed + run: cargo build -p zed bundle: name: Bundle app runs-on: - self-hosted - bundle if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-build-dmg') }} - needs: tests + needs: [macos_tests, linux_tests] env: MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} diff --git a/.github/workflows/deploy_collab.yml b/.github/workflows/deploy_collab.yml index 432bafb360a0eafa7d7741f1de313d68cd846965..953e4f1190f119c43ed3ef3218d93875ec199f5b 100644 --- a/.github/workflows/deploy_collab.yml +++ b/.github/workflows/deploy_collab.yml @@ -27,6 +27,10 @@ jobs: - name: Run style checks uses: ./.github/actions/check_style + - name: Run clippy + shell: bash -euxo pipefail {0} + run: script/clippy + tests: name: Run tests runs-on: diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index c9b4097265a2e5a63d70d001e354d5df051bd422..e826badb5b1386f7ee52799f01b04ad7be70c829 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -31,6 +31,9 @@ jobs: - name: Run style checks uses: ./.github/actions/check_style + - name: Run clippy + shell: bash -euxo pipefail {0} + run: script/clippy tests: name: Run tests if: github.repository_owner == 'zed-industries' diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index d2c8f5f854f0f97de285b6381c9f7208cf63ca28..1776ee00b7e873d605f16ba3db001d45ff7efe10 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -231,22 +231,6 @@ impl Platform for LinuxPlatform { Box::new(LinuxWindow(window_ptr)) } - fn set_display_link_output_callback( - &self, - display_id: DisplayId, - callback: Box, - ) { - log::warn!("unimplemented: set_display_link_output_callback"); - } - - fn start_display_link(&self, display_id: DisplayId) { - unimplemented!() - } - - fn stop_display_link(&self, display_id: DisplayId) { - unimplemented!() - } - fn open_url(&self, url: &str) { unimplemented!() } diff --git a/script/clippy b/script/clippy new file mode 100755 index 0000000000000000000000000000000000000000..1a817015f3fe8c8ef1f728ca5b823202d8d8b8fb --- /dev/null +++ b/script/clippy @@ -0,0 +1,7 @@ +#!/bin/bash + +# clippy.toml is not currently supporting specifying allowed lints +# so specify those here, and disable the rest until Zed's workspace +# will have more fixes & suppression for the standard lint set +cargo clippy --release --workspace --all-features --all-targets -- -A clippy::all -D clippy::dbg_macro -D clippy::todo +cargo clippy -p gpui diff --git a/script/linux b/script/linux index f672ed8b85dbe6189a5446fe0af4e5d814cfa2b5..2431d220525479dfd3604878414ecb60cd0fe9b5 100755 --- a/script/linux +++ b/script/linux @@ -1,25 +1,7 @@ #!/usr/bin/bash -e -# if not on Linux, do nothing -[[ $(uname) == "Linux" ]] || exit 0 - -# Copy assets to the user's home directory if they don't exist -mkdir -p "$HOME/.config/zed" - -mkdir -p "$HOME/.config/zed/plugins" - -mkdir -p "$HOME/.config/zed/themes" -cp -ruL ./assets/themes/*/*.json "$HOME/.config/zed/themes" - -test -f "$HOME/.config/zed/settings.json" || - cp -uL ./assets/settings/initial_user_settings.json "$HOME/.config/zed/settings.json" - -test -f "$HOME/.config/zed/keymap.json" || - cp -uL ./assets/keymaps/default.json "$HOME/.config/zed/keymap.json" - # if sudo is not installed, define an empty alias maysudo=$(command -v sudo || true) -export maysudo # Ubuntu, Debian, etc. # https://packages.ubuntu.com/