-
Notifications
You must be signed in to change notification settings - Fork 19
install diff-filter-buildkite-plugin to only build when relevant files changed #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fatteneder
wants to merge
20
commits into
JuliaCI:main
Choose a base branch
from
fatteneder:fa/diff-filter-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
af2b633
install diff-filter-build
fatteneder 9ebd2d7
add diff-filter-doc
fatteneder 698c572
update *upload_jobs.yml
fatteneder 70c3fd9
rm diff-filter-doc, but build at least x86_64-linux
fatteneder 8d4b31e
add option to force build using a PR label
fatteneder 3fbc5a2
rename trigger variable
fatteneder 6ff8918
update ignore list
fatteneder 5ef9ed8
add missing BUILD exports
fatteneder 52f2af1
provide bash script as string for docker plugin command
fatteneder 2ab621e
fix an if condition
fatteneder b8224c2
can we use the step's command instead of docker's?
fatteneder 65dff2f
try without multiline strings
fatteneder 13c10cb
try with cmd.exe if
fatteneder 1322934
set diff-filter's target_branch option conditionally using environmen…
fatteneder c44f2b7
use grep -E everywhere for compatability reasons
fatteneder c9a95fb
add an env var for the target branch
fatteneder dc5ce91
forward env vars to upload script
fatteneder 368cc29
fix varname
fatteneder e904a52
also trigger build if PR gets merged
fatteneder 4942000
Revert "forward env vars to upload script"
fatteneder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,24 @@ | |
| # and only need to touch the webui configuration when we need to alter | ||
| # something about the privileged steps. | ||
|
|
||
| env: | ||
| DIFF_FILTER_TARGET_BRANCH: "" | ||
|
|
||
| common: | ||
| - diff-filter-build_plugin: &diff-filter-build | ||
| https://github.com/fatteneder/diff-filter-buildkite-plugin#main: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this should be moved to this organisation before merge. |
||
| name: "TRIGGER_BUILD" | ||
| ignore: | ||
| - "*.md" | ||
| - ".*" | ||
| - "julia.spdx.json" | ||
| - "CITATION.*" | ||
| - "typos.toml" | ||
| target_branch: "${DIFF_FILTER_TARGET_BRANCH?}" | ||
| - pr-labels_plugin: &pr-labels | ||
| sv-oss/github-pr-labels#v0.0.2: | ||
| publish-env-var: PULL_REQUEST_LABELS | ||
|
|
||
| steps: | ||
| - group: "Build" | ||
| notify: | ||
|
|
@@ -33,35 +51,45 @@ steps: | |
| # that this script doesn't suddenly break when a new patch release of Julia | ||
| # is released. | ||
| version: '1.7.3' | ||
| - *diff-filter-build | ||
| - *pr-labels | ||
| commands: | | ||
| ### Launch Linux build jobs. | ||
| FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) | ||
| MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) | ||
| BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED})) | ||
| ### Launch Linux build jobs | ||
| # Regular: | ||
| GROUP="Build" \ | ||
| ALLOW_FAIL="false" \ | ||
| BUILD="$${BUILD}" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/build_linux.arches \ | ||
| .buildkite/pipelines/main/platforms/build_linux.yml | ||
| # PowerPC (only for Julia prior to 1.12): | ||
| GROUP="Build" \ | ||
| ALLOW_FAIL="false" \ | ||
| BUILD="$${BUILD}" \ | ||
| julia .buildkite/pipelines/main/platforms/launch_powerpc.jl \ | ||
| .buildkite/pipelines/main/platforms/build_linux.powerpc.arches \ | ||
| .buildkite/pipelines/main/platforms/build_linux.yml | ||
| ### Launch macOS build jobs: | ||
| ### Launch macOS packaging jobs | ||
| GROUP="Build" \ | ||
| ALLOW_FAIL="false" \ | ||
| BUILD="$${BUILD}" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/build_macos.arches \ | ||
| .buildkite/pipelines/main/platforms/build_macos.yml | ||
| ### Launch FreeBSD build jobs: | ||
| GROUP="Build" \ | ||
| ALLOW_FAIL="false" \ | ||
| BUILD="$${BUILD}" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/build_freebsd.arches \ | ||
| .buildkite/pipelines/main/platforms/build_freebsd.yml | ||
| ### Launch Windows build jobs: | ||
| GROUP="Build" \ | ||
| ALLOW_FAIL="false" \ | ||
| BUILD="$${BUILD}" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/build_windows.arches \ | ||
| .buildkite/pipelines/main/platforms/build_windows.yml | ||
|
|
@@ -79,17 +107,24 @@ steps: | |
| - JuliaCI/external-buildkite#v1: | ||
| version: "./.buildkite-external-version" | ||
| repo_url: "https://github.com/JuliaCI/julia-buildkite" | ||
| - *diff-filter-build | ||
| - *pr-labels | ||
| commands: | | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/analyzegc.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/doctest.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/pdf_docs/build_pdf_docs.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/embedding.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/trimming.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/llvmpasses.yml | ||
| # buildkite-agent pipeline upload .buildkite/pipelines/main/misc/whitespace.yml # Currently runs in GitHub Actions instead of Buildkite | ||
| FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) | ||
| MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) | ||
| BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED})) | ||
| if [[ $${BUILD} == 1 ]]; then | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/analyzegc.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/embedding.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/trimming.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/llvmpasses.yml | ||
| # buildkite-agent pipeline upload .buildkite/pipelines/main/misc/whitespace.yml # Currently runs in GitHub Actions instead of Buildkite | ||
|
|
||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/sanitizers/asan.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/sanitizers/tsan.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/sanitizers/asan.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/sanitizers/tsan.yml | ||
| fi | ||
| agents: | ||
| queue: "julia" | ||
| os: "linux" | ||
|
|
@@ -104,38 +139,44 @@ steps: | |
| - JuliaCI/external-buildkite#v1: | ||
| version: "./.buildkite-external-version" | ||
| repo_url: "https://github.com/JuliaCI/julia-buildkite" | ||
| - *diff-filter-build | ||
| - *pr-labels | ||
| commands: | | ||
| export ALLOW_FAIL="false" | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/gcext.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/test_revise.yml | ||
| FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) | ||
| MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) | ||
| BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED})) | ||
| if [[ $${BUILD} == 1 ]]; then | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/gcext.yml | ||
| buildkite-agent pipeline upload .buildkite/pipelines/main/misc/test_revise.yml | ||
|
|
||
| ### Launch Linux test jobs. | ||
| # Regular: | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_linux.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.yml | ||
| # i686-linux-gnu: | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_linux.i686.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.i686.yml | ||
| ### Launch macOS test jobs: | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_macos.arches \ | ||
| .buildkite/pipelines/main/platforms/test_macos.yml | ||
| ### Launch FreeBSD test jobs: | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.arches \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.yml | ||
| ### Launch Windows test jobs: | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_windows.arches \ | ||
| .buildkite/pipelines/main/platforms/test_windows.yml | ||
| echo "+++ Finished launching test jobs" | ||
| ### Launch Linux test jobs. | ||
| # Regular: | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_linux.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.yml | ||
| # i686-linux-gnu: | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_linux.i686.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.i686.yml | ||
| ### Launch macOS test jobs | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_macos.arches \ | ||
| .buildkite/pipelines/main/platforms/test_macos.yml | ||
| ### Launch FreeBSD test jobs | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.arches \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.yml | ||
| ### Launch windows test jobs | ||
| GROUP="Test" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_windows.arches \ | ||
| .buildkite/pipelines/main/platforms/test_windows.yml | ||
| fi | ||
| agents: | ||
| queue: "julia" | ||
| os: "linux" | ||
|
|
@@ -147,15 +188,22 @@ steps: | |
| - JuliaCI/external-buildkite#v1: | ||
| version: "./.buildkite-external-version" | ||
| repo_url: "https://github.com/JuliaCI/julia-buildkite" | ||
| - *diff-filter-build | ||
| - *pr-labels | ||
| commands: | | ||
| export ALLOW_FAIL="true" | ||
| # Launch Linux allowed-to-fail build jobs: | ||
| FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) | ||
| MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) | ||
| BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED})) | ||
| # Launch Linux allowed-to-fail build jobs | ||
| GROUP="Allow Fail" \ | ||
| BUILD="$${BUILD}" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/build_linux.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/build_linux.yml | ||
| # Launch macOS allowed-to-fail build jobs: | ||
| # Launch macOS allowed-to-fail build jobs | ||
| GROUP="Allow Fail" \ | ||
| BUILD="$${BUILD}" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/build_macos.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/build_macos.yml | ||
|
|
@@ -178,35 +226,41 @@ steps: | |
| # that this script doesn't suddenly break when a new patch release of Julia | ||
| # is released. | ||
| version: '1.7.3' | ||
| - *diff-filter-build | ||
| - *pr-labels | ||
| commands: | | ||
| export ALLOW_FAIL="true" | ||
|
|
||
| ### Launch Linux allowed-to-fail test jobs. | ||
| # Regular: | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_linux.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.yml | ||
| # PowerPC (only for Julia prior to 1.12): | ||
| GROUP="Test" \ | ||
| julia .buildkite/pipelines/main/platforms/launch_powerpc.jl \ | ||
| .buildkite/pipelines/main/platforms/test_linux.powerpc.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.yml | ||
| ### Launch macOS allowed-to-fail test jobs: | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_macos.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_macos.yml | ||
| ### Launch FreeBSD allowed-to-fail jobs: | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.yml | ||
| ### Launch Windows allowed-to-fail test jobs: | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_windows.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_windows.yml | ||
| FORCE=$(test -n "$(echo $${PULL_REQUEST_LABELS} | grep -E "\bci-force-build\b")" && echo 1 || echo 0) | ||
| MERGED=$(test "$${BUILDKITE_PULL_REQUEST}" = "false" && echo 1 || echo 0) | ||
| BUILD=$(($${TRIGGER_BUILD} || $${FORCE} || $${MERGED})) | ||
| if [[ $${BUILD} == 1 ]]; then | ||
| ### Launch Linux allowed-to-fail test jobs. | ||
| # Regular: | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_linux.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.yml | ||
| # PowerPC (only for Julia prior to 1.12): | ||
| GROUP="Test" \ | ||
| julia .buildkite/pipelines/main/platforms/launch_powerpc.jl \ | ||
| .buildkite/pipelines/main/platforms/test_linux.powerpc.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_linux.yml | ||
| ### Launch macOS allowed-to-fail test jobs | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_macos.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_macos.yml | ||
| ### Launch FreeBSD allowed-to-fail jobs | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_freebsd.yml | ||
| ### Launch windows allowed-to-fail test jobs | ||
| GROUP="Allow Fail" \ | ||
| bash .buildkite/utilities/arches_pipeline_upload.sh \ | ||
| .buildkite/pipelines/main/platforms/test_windows.soft_fail.arches \ | ||
| .buildkite/pipelines/main/platforms/test_windows.yml | ||
| fi | ||
| agents: | ||
| queue: "julia" | ||
| os: "linux" | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only needed as this repo's main branch is called "main" whereas the one of the Julia repo is called "master".
Using a default of
DIFF_FILTER_TARGET_BRANCH=""tells thediff-filter-buildkite-pluginto use a PR's merge base as the reference against which changes should be compared (https://github.com/fatteneder/diff-filter-buildkite-plugin/blob/7155804f7ba73a9798b4c4225613ca6a5d7d8c12/hooks/diff-filter-impl#L13-L38).So if the pipeline run's on forks of Julia's repo, it should do the right thing (although untested) even when PRing against a branch other than master. For PRs against
julia-buildkitewe always compare against Julia's master by manually setting it in.buildkite/hooks/post-checkout.