Skip to content
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

CI (Buildkite): on pull request builds, build the merge commit (e.g. refs/pull/1234/merge) #42403

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
steps:
- label: ":buildkite: Launch unsigned pipelines"
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Launch unsigned pipelines"
buildkite-agent pipeline upload .buildkite/pipelines/experimental/misc/sanitizers.yml
agents:
queue: julia
3 changes: 3 additions & 0 deletions .buildkite/pipelines/experimental/misc/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ steps:
version: 1.6
timeout_in_minutes: 120
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Build julia-debug with ASAN"
contrib/asan/build.sh ./tmp/test-asan -j$${JULIA_CPU_THREADS:?} debug
5 changes: 5 additions & 0 deletions .buildkite/pipelines/main/launch_unsigned_builders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
steps:
- label: ":buildkite: Launch unsigned builders"
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Launch unsigned builders"

# Launch the `whitespace` builder first, because we want that builder to finish as quickly as possible.
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/whitespace.yml

Expand Down
3 changes: 3 additions & 0 deletions .buildkite/pipelines/main/misc/doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ steps:
# Include `/cache/repos` so that our `git` version introspection works.
- "/cache/repos:/cache/repos"
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Build Julia from source"
make -j 6

Expand Down
7 changes: 5 additions & 2 deletions .buildkite/pipelines/main/misc/embedding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ steps:
# Include `/cache/repos` so that our `git` version introspection works.
- "/cache/repos:/cache/repos"
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

prefix="/tmp/prefix"
echo "+++ Build julia, deploy to $${prefix:?}"
echo "--- Build julia, deploy to $${prefix:?}"
make -j$${JULIA_CPU_THREADS:?} JULIA_PRECOMPILE=0 prefix=$${prefix:?} install

embedding_output="/tmp/embedding-test"
echo "+++ Run embedding tests, deploy to $${embedding_output:?}"
echo "--- Run embedding tests, deploy to $${embedding_output:?}"
mkdir -p "$${embedding_output:?}"
make -j$${JULIA_CPU_THREADS:?} -C test/embedding JULIA="$${prefix:?}/bin/julia" BIN="$${embedding_output:?}"
timeout_in_minutes: 60
6 changes: 6 additions & 0 deletions .buildkite/pipelines/main/misc/llvmpasses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ steps:
# Include `/cache/repos` so that our `git` version introspection works.
- "/cache/repos:/cache/repos"
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Install in-tree LLVM dependencies"
make -j$${JULIA_CPU_THREADS:?} -C deps install-llvm install-clang install-llvm-tools install-libuv install-utf8proc install-unwind
echo "+++ run clangsa/analyzegc"
Expand All @@ -35,6 +38,9 @@ steps:
workspaces:
- "/cache/repos:/cache/repos"
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- make release"
make -j$${JULIA_CPU_THREADS:?} release JULIA_PRECOMPILE=0
echo "--- make src/install-analysis-deps"
Expand Down
4 changes: 4 additions & 0 deletions .buildkite/pipelines/main/misc/whitespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ steps:
- github_commit_status:
context: "whitespace"
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Run the whitespace check"
make -j$${JULIA_CPU_THREADS:?} check-whitespace
11 changes: 8 additions & 3 deletions .buildkite/pipelines/main/platforms/package_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ steps:
- "/cache/repos:/cache/repos"
timeout_in_minutes: ${TIMEOUT?}
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Print the full and short commit hashes"
SHORT_COMMIT_LENGTH=10
SHORT_COMMIT=`echo $${BUILDKITE_COMMIT:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}`
CHECKED_OUT_COMMIT_FULL=`git rev-parse HEAD`
CHECKED_OUT_COMMIT_SHORT=`echo $${CHECKED_OUT_COMMIT_FULL:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}`
JULIA_BINARYDIST_FILENAME=`make print-JULIA_BINARYDIST_FILENAME | cut -c27-`
ARTIFACT_FILE_EXTENSION="tar.gz"
ARTIFACT_FILENAME="$${JULIA_BINARYDIST_FILENAME:?}.$${ARTIFACT_FILE_EXTENSION:?}"
echo "The full commit is: $${BUILDKITE_COMMIT:?}"
echo "The short commit is: $${SHORT_COMMIT:?}"
echo "The original Buildkite commit is: $${BUILDKITE_COMMIT:?}"
echo "The full checked-out commit is: $${CHECKED_OUT_COMMIT_FULL:?}"
echo "The short checked-out commit is: $${CHECKED_OUT_COMMIT_SHORT:?}"
echo "The artifact filename will be: $${ARTIFACT_FILENAME:?}"

echo "--- Build Julia from source"
Expand Down
17 changes: 11 additions & 6 deletions .buildkite/pipelines/main/platforms/tester_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,21 @@ steps:
JULIA_SHELL: "/bin/bash"
timeout_in_minutes: ${TIMEOUT?}
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Print the full and short commit hashes"
SHORT_COMMIT_LENGTH=10
SHORT_COMMIT=`echo $${BUILDKITE_COMMIT:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}`
JULIA_DIR="julia-$${SHORT_COMMIT:?}"
CHECKED_OUT_COMMIT_FULL=`git rev-parse HEAD`
CHECKED_OUT_COMMIT_SHORT=`echo $${CHECKED_OUT_COMMIT_FULL:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}`
JULIA_DIR="julia-$${CHECKED_OUT_COMMIT_SHORT:?}"
JULIA_BINARY="$${JULIA_DIR:?}/bin/julia"
ARTIFACT_FILE_EXTENSION="tar.gz"
ARTIFACT_FILENAME="julia-$${SHORT_COMMIT:?}-linux${ARCH?}.$${ARTIFACT_FILE_EXTENSION:?}"
echo "The full commit is: $${BUILDKITE_COMMIT:?}"
echo "The short commit is: $${SHORT_COMMIT:?}"
echo "The artifact filename will be: $${ARTIFACT_FILENAME:?}"
ARTIFACT_FILENAME="julia-$${CHECKED_OUT_COMMIT_SHORT:?}-linux${ARCH?}.$${ARTIFACT_FILE_EXTENSION:?}"
echo "The original Buildkite commit is: $${BUILDKITE_COMMIT:?}"
echo "The full checked-out commit is: $${CHECKED_OUT_COMMIT_FULL:?}"
echo "The short checked-out commit is: $${CHECKED_OUT_COMMIT_SHORT:?}"
echo "The artifact filename will be: $${ARTIFACT_FILENAME:?}"
echo "The Julia directory name will be: $${JULIA_DIR:?}"
echo "The Julia binary will be: $${JULIA_BINARY:?}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ steps:
uid: 1000
gid: 1000
commands: |
echo "--- Checkout the merge commit (if this is a pull request build)"
MCSH=.buildkite/utilities/merge_commit/merge_commit.sh && test -f $${MCSH:?} && bash $${MCSH:?}

echo "--- Build Julia from source"
make -j 6

Expand Down
18 changes: 18 additions & 0 deletions .buildkite/utilities/merge_commit/merge_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -euo pipefail
if [[ "${BUILDKITE_PULL_REQUEST:?}" != "false" ]]; then
git log -n 1
echo ""
echo "This is a pull request build."
echo "Pull request: ${BUILDKITE_PULL_REQUEST:?}"
echo "Fetching the pull request merge commit..."
sleep 0.01 # Make sure GitHub has enough time to create the merge commit.
git fetch origin +refs/pull/${BUILDKITE_PULL_REQUEST:?}/merge
echo "Checking out the pull request merge commit..."
git checkout --force FETCH_HEAD
else
echo "This is not a pull request build."
fi

git log -n 1
echo ""