-
Notifications
You must be signed in to change notification settings - Fork 45
buildomat: move Linux build-and-test to buildomat #1518
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
Merged
Merged
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
#: | ||
#: name = "build-and-test (ubuntu-20.04)" | ||
#: variety = "basic" | ||
#: target = "ubuntu-20.04" | ||
#: rust_toolchain = "nightly-2022-04-27" | ||
#: output_rules = [ | ||
#: "/var/tmp/omicron_tmp/*", | ||
#: "!/var/tmp/omicron_tmp/crdb-base*", | ||
#: "!/var/tmp/omicron_tmp/rustc*", | ||
#: ] | ||
#: | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o xtrace | ||
|
||
cargo --version | ||
rustc --version | ||
|
||
# | ||
# Set up a custom temporary directory within whatever one we were given so that | ||
# we can check later whether we left detritus around. | ||
# | ||
TEST_TMPDIR='/var/tmp/omicron_tmp' | ||
echo "tests will store output in $TEST_TMPDIR" >&2 | ||
mkdir "$TEST_TMPDIR" | ||
|
||
# | ||
# Put "./cockroachdb/bin" and "./clickhouse" on the PATH for the test | ||
# suite. | ||
# | ||
export PATH="$PATH:$PWD/out/cockroachdb/bin:$PWD/out/clickhouse" | ||
|
||
banner prerequisites | ||
ptime -m bash ./tools/install_builder_prerequisites.sh -y | ||
|
||
# | ||
# We build with: | ||
# | ||
# - RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings": disallow warnings | ||
# in CI builds. This can result in breakage when the toolchain is | ||
# updated, but that should only happen with a change to the repo, which | ||
# gives us an opportunity to find and fix any newly-introduced warnings. | ||
# | ||
# - `--locked`: do not update Cargo.lock when building. Checking in | ||
# Cargo.lock ensures that everyone is using the same dependencies and | ||
# also gives us a record of which dependencies were used for each CI | ||
# run. Building with `--locked` ensures that the checked-in Cargo.lock | ||
# is up to date. | ||
# | ||
banner build | ||
export RUSTFLAGS="-D warnings" | ||
export RUSTDOCFLAGS="-D warnings" | ||
export TMPDIR=$TEST_TMPDIR | ||
ptime -m cargo +'nightly-2022-04-27' build --locked --all-targets --verbose | ||
|
||
# | ||
# NOTE: We're using using the same RUSTFLAGS and RUSTDOCFLAGS as above to avoid | ||
# having to rebuild here. | ||
# | ||
banner test | ||
ptime -m cargo +'nightly-2022-04-27' test --workspace --locked --verbose \ | ||
--no-fail-fast | ||
|
||
# | ||
# Make sure that we have left nothing around in $TEST_TMPDIR. The easiest way | ||
# to check is to try to remove it with `rmdir`. | ||
# | ||
unset TMPDIR | ||
echo "files in $TEST_TMPDIR (none expected on success):" >&2 | ||
find "$TEST_TMPDIR" -ls | ||
rmdir "$TEST_TMPDIR" |
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
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.
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.
Matrix-like support would be nice for Buildomat in the future, since these scripts are otherwise mostly the same.
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.
I agree! I added a few cross-platform shims to the images at the time so that they could be identical without effectively an ifdef soup: https://github.com/oxidecomputer/buildomat#available-commands
Matrix support is definitely on my list.