diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index efa4e4125..8b2c1608a 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -12,10 +12,43 @@ steps: command: .buildkite/prettier-check.sh agents: { queue: "vagrant" } - - label: ":rice: docker-compose-test" + # Builds on main always run the smoke test. if_changed compares against origin/main, + # so it finds no changes in a commit which is already on main, unless it is the newest + - &smoke_test + label: ":rice: docker-compose-test" command: .buildkite/vagrant-run.sh docker-test artifact_paths: ./*.log agents: { queue: "vagrant" } + if: build.branch == "main" + + # Builds on other branches skip the smoke test if they only change files it does not read. + # New files run it, until someone adds them here + - <<: *smoke_test + if: build.branch != "main" + if_changed: + include: "**" + exclude: + # Docs, including the PR template and READMEs in mounted directories + - "**.md" + # GitHub Actions, editor and repository settings + - ".github/**" + - ".vscode/**" + - ".gitignore" + - "renovate.json" + # Release manifests + - "release.yaml" + - "batch-change/**" + # Prettier inputs, which the :lipstick: step checks + - ".prettierignore" + - "prettier.config.js" + - "package.json" + - "package-lock.json" + # Compose files the smoke test does not start + - "docker-compose/db-only-migrate.docker-compose.yaml" + - "docker-compose/dev/**" + - "docker-compose/examples/**" + # Caddyfiles the base file leaves commented out + - "caddy/builtins/https.*" # Please keep in mind that the release manifest uses specific branch names when creating releases. # Therefore, if you update them, or if you decide to change how we detect what kind of build we're dealing diff --git a/AGENTS.md b/AGENTS.md index c2db844db..9becd1df8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,6 +24,7 @@ CI runs these on every branch. `.tool-versions` pins Node and the GitHub CLI; CI - `test/smoke-test.sh` starts the base file, and compares the number of running containers with `expect_containers`. Update that number in the same pull request that adds or removes a service. - CI does not run `test/executor-smoke-test.sh`. Run it against a running deployment when you change `docker-compose/executors/`. +- A branch which only changes files listed in the step's `if_changed` `exclude` skips the step. Builds on `main` always run it. When the smoke test starts reading a file on that list, remove it from the list. - The VM image is built from `gcp/images/e2e` in sourcegraph/infrastructure. ## Conventions