Skip to content

Commit 8bbd101

Browse files
authored
ci: Run check_docs when code changes (zed-industries#43188)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
1 parent dbdc501 commit 8bbd101

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.github/workflows/run_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
}
4848
4949
check_pattern "run_action_checks" '^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/' -qP
50-
check_pattern "run_docs" '^docs/' -qP
50+
check_pattern "run_docs" '^(docs/|crates/.*\.rs)' -qP
5151
check_pattern "run_licenses" '^(Cargo.lock|script/.*licenses)' -qP
5252
check_pattern "run_nix" '^(nix/|flake\.|Cargo\.|rust-toolchain.toml|\.cargo/config.toml)' -qP
5353
check_pattern "run_tests" '^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests)))' -qvP

tooling/xtask/src/tasks/workflows.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ mod vars;
2323
pub struct GenerateWorkflowArgs {}
2424

2525
pub fn run_workflows(_: GenerateWorkflowArgs) -> Result<()> {
26+
if !Path::new("crates/zed/").is_dir() {
27+
anyhow::bail!("xtask workflows must be ran from the project root");
28+
}
2629
let dir = Path::new(".github/workflows");
2730

2831
let workflows = vec![

tooling/xtask/src/tasks/workflows/run_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(crate) fn run_tests() -> Workflow {
2525
"run_tests",
2626
r"^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests)))",
2727
);
28-
let should_check_docs = PathCondition::new("run_docs", r"^docs/");
28+
let should_check_docs = PathCondition::new("run_docs", r"^(docs/|crates/.*\.rs)");
2929
let should_check_scripts = PathCondition::new(
3030
"run_action_checks",
3131
r"^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/",

0 commit comments

Comments
 (0)