diff --git a/.github/actions/check_style/action.yml b/.github/actions/check_style/action.yml index 7f41e710c913581c34dd6139ff9232648ccd6deb..9bddee44ef52182c9a4410e3c6659486312c746f 100644 --- a/.github/actions/check_style/action.yml +++ b/.github/actions/check_style/action.yml @@ -4,12 +4,11 @@ description: "Checks code formatting use cargo fmt" runs: using: "composite" steps: + - name: Check for Typos with Typos-CLI + uses: crate-ci/typos@v1.24.6 + with: + config: ./typos.toml + - name: cargo fmt shell: bash -euxo pipefail {0} run: cargo fmt --all -- --check - - - name: Find modified migrations - shell: bash -euxo pipefail {0} - run: | - export SQUAWK_GITHUB_TOKEN=${{ github.token }} - . ./script/squawk diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eadd738fa5ab327787f82ce50aa565f1acb65a50..adf0cfa30f5fd74b53fc14726010c67c962e59f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,10 @@ env: RUST_BACKTRACE: 1 jobs: - style: + migration_checks: + name: Check Postgres and Protobuf migrations, mergability + if: github.repository_owner == 'zed-industries' timeout-minutes: 60 - name: Check formatting and spelling runs-on: - self-hosted - test @@ -37,25 +38,16 @@ jobs: uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: clean: false - fetch-depth: 0 + fetch-depth: 0 # fetch full history - name: Remove untracked files run: git clean -df - - name: Check spelling - run: script/check-spelling - - - name: Run style checks - uses: ./.github/actions/check_style - - - name: Check unused dependencies - uses: bnjbvr/cargo-machete@main - - - name: Check licenses are present - run: script/check-licenses - - - name: Check license generation - run: script/generate-licenses /tmp/zed_licenses_output + - name: Find modified migrations + shell: bash -euxo pipefail {0} + run: | + export SQUAWK_GITHUB_TOKEN=${{ github.token }} + . ./script/squawk - name: Ensure fresh merge shell: bash -euxo pipefail {0} @@ -77,6 +69,19 @@ jobs: input: "crates/proto/proto/" against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/" + style: + timeout-minutes: 60 + name: Check formatting and spelling + if: github.repository_owner == 'zed-industries' + runs-on: + - buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + + - name: Run style checks + uses: ./.github/actions/check_style + macos_tests: timeout-minutes: 60 name: (macOS) Run Clippy and tests @@ -92,6 +97,14 @@ jobs: - name: cargo clippy run: ./script/clippy + - name: Check unused dependencies + uses: bnjbvr/cargo-machete@main + + - name: Check licenses + run: | + script/check-licenses + script/generate-licenses /tmp/zed_licenses_output + - name: Run tests uses: ./.github/actions/run_tests diff --git a/.github/workflows/deploy_cloudflare.yml b/.github/workflows/deploy_cloudflare.yml index 029a2092d98349e50160848a7070c094ce9f3258..1c9e7bc5b08bba6e018b10533570a214979eda49 100644 --- a/.github/workflows/deploy_cloudflare.yml +++ b/.github/workflows/deploy_cloudflare.yml @@ -8,6 +8,7 @@ on: jobs: deploy-docs: name: Deploy Docs + if: github.repository_owner == 'zed-industries' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b291ca3742fcebf76fad6549835415182d5597d..437e7f96a678f489a1a72c058b2c0639cf929af6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,6 +11,7 @@ on: jobs: check_formatting: name: "Check formatting" + if: github.repository_owner == 'zed-industries' runs-on: ubuntu-latest steps: @@ -29,5 +30,8 @@ jobs: false } - - name: Check spelling - run: script/check-spelling docs/ + - name: Check for Typos with Typos-CLI + uses: crate-ci/typos@v1.24.6 + with: + config: ./typos.toml + files: ./docs/ diff --git a/script/check-spelling b/script/check-spelling deleted file mode 100755 index 76ebf747286447629045fe3d9994686492fcaf48..0000000000000000000000000000000000000000 --- a/script/check-spelling +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -eu - -TYPOS_CLI_VERSION=1.24.6 -TARGET_DIR=${1:-""} - -if ! cargo install --list | grep "typos-cli v$TYPOS_CLI_VERSION" > /dev/null; then - echo "Installing typos-cli@$TYPOS_CLI_VERSION..." - cargo install "typos-cli@$TYPOS_CLI_VERSION" -else - echo "typos-cli@$TYPOS_CLI_VERSION is already installed." -fi -typos $TARGET_DIR