Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ci: Block PRs on Nix build failures (#33688)

Julia Ryana11647d07f30
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3b6e014d259..39036ef5649 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -30,6 +30,7 @@ jobs:
run_tests: ${{ steps.filter.outputs.run_tests }}
run_license: ${{ steps.filter.outputs.run_license }}
run_docs: ${{ steps.filter.outputs.run_docs }}
+ run_nix: ${{ steps.filter.outputs.run_nix }}
runs-on:
- ubuntu-latest
steps:
@@ -69,6 +70,12 @@ jobs:
else
echo "run_license=false" >> $GITHUB_OUTPUT
fi
+ NIX_REGEX='^(nix/|flake\.|Cargo\.|rust-toolchain.toml|\.cargo/config.toml)'
+ if [[ $(git diff --name-only $COMPARE_REV ${{ github.sha }} | grep "$NIX_REGEX") ]]; then
+ echo "run_nix=true" >> $GITHUB_OUTPUT
+ else
+ echo "run_nix=false" >> $GITHUB_OUTPUT
+ fi
migration_checks:
name: Check Postgres and Protobuf migrations, mergability
@@ -746,7 +753,10 @@ jobs:
nix-build:
name: Build with Nix
uses: ./.github/workflows/nix.yml
- if: github.repository_owner == 'zed-industries' && contains(github.event.pull_request.labels.*.name, 'run-nix')
+ needs: [job_spec]
+ if: github.repository_owner == 'zed-industries' &&
+ (contains(github.event.pull_request.labels.*.name, 'run-nix') ||
+ needs.job_spec.outputs.run_nix == 'true')
secrets: inherit
with:
flake-output: debug