mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-24 07:32:51 +00:00
30 lines
1.3 KiB
YAML
30 lines
1.3 KiB
YAML
name: "Check formatting"
|
|
description: "Checks code formatting use cargo fmt"
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: cargo fmt
|
|
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 --workspace --all-features --all-targets -- -A clippy::all -D clippy::dbg_macro -D clippy::todo
|
|
|
|
- name: Find modified migrations
|
|
shell: bash -euxo pipefail {0}
|
|
run: |
|
|
cargo install squawk --git https://github.com/sbdchd/squawk --tag v0.26.0
|
|
modified_migrations=$(git diff --name-only origin/$GITHUB_BASE_REF...origin/$GITHUB_HEAD_REF 'crate/collab/migrations/*.sql')
|
|
|
|
SQUAWK_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
|
SQUAWK_GITHUB_REPO_OWNER=$(echo $GITHUB_REPOSITORY | awk -F/ '{print $1}')
|
|
SQUAWK_GITHUB_REPO_NAME=$(echo $GITHUB_REPOSITORY | awk -F/ '{print $2}')
|
|
SQUAWK_GITHUB_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
|
|
squawk upload-to-github $(modified_migrations)
|