Skip to content

Commit

Permalink
CI (Buildkite): on pull request builds, build the merge commit (e.g. …
Browse files Browse the repository at this point in the history
…`refs/pull/1234/merge`)
  • Loading branch information
DilumAluthge committed Sep 28, 2021
1 parent 4dea1c4 commit fb42d78
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 2 deletions.
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
3 changes: 3 additions & 0 deletions .buildkite/pipelines/main/platforms/package_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ 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:?}`
Expand Down
3 changes: 3 additions & 0 deletions .buildkite/pipelines/main/platforms/tester_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ 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:?}`
Expand Down
3 changes: 3 additions & 0 deletions .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml
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
16 changes: 16 additions & 0 deletions .buildkite/utilities/merge_commit/merge_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [[ "${BUILDKITE_PULL_REQUEST:?}" != "false" ]]; then
git log -n 1
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

0 comments on commit fb42d78

Please sign in to comment.