forked from postgres/postgres
-
Notifications
You must be signed in to change notification settings - Fork 10
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: Add feature to use different meson versions #82
Open
nbyavuz
wants to merge
1
commit into
anarazel:meson-upstream-master
Choose a base branch
from
nbyavuz:meson-test-all-versions
base: meson-upstream-master
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
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 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 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 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,51 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
case $CIRRUS_OS in | ||
freebsd | linux | darwin | windows | mingw) | ||
;; | ||
*) | ||
echo "unsupported operating system ${CIRRUS_OS}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# install meson by using pip | ||
install_meson () { | ||
python3 -m pip install git+${MESON_REPO}@${MESON_BRANCH} | ||
} | ||
|
||
run_rebase_commands() { | ||
git config user.email 'postgres-ci@example.com' | ||
git config user.name 'Postgres CI' | ||
# windows loses the executable bit, causing an unnecessary diff | ||
git config core.filemode false | ||
# windows changes file endings to crlf, causing test failures | ||
git config core.autocrlf false | ||
git remote add default-postgres https://github.com/postgres/postgres.git | ||
git fetch default-postgres master | ||
echo "Rebasing onto: $(git show --no-patch --abbrev-commit --pretty=oneline default-postgres/master)" | ||
git rebase --autostash --no-verify default-postgres/master | ||
} | ||
|
||
# Rebase current branch onto Postgres HEAD | ||
rebase_onto_postgres () { | ||
# safe directory need to be set because of dubious ownership error | ||
# debian complains $HOME not set when --global is used | ||
# macOS complains about permissions when --system is used | ||
# so, use --global for macOS and --system for others | ||
case $CIRRUS_OS in | ||
darwin) | ||
git config --global --add safe.directory /tmp/cirrus-ci-build | ||
;; | ||
*) | ||
git config --system --add safe.directory /tmp/cirrus-ci-build | ||
;; | ||
esac | ||
run_rebase_commands | ||
} | ||
|
||
install_meson | ||
rebase_onto_postgres |
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.
I think it's probably worth just doing this for all tasks, rather than just this one in the matrix.
I'd really like if we could put the invocation into a single place instead of needing to repeat it in many places. But it's not exactly obvious how. Looks like I should have made all tasks in postgres' .cirrus inline the same yaml block, to make it easier to do stuff like this.
I was wondering if we could use https://cirrus-ci.org/guide/programming-tasks/ to make this easier, but I couldn't find a way.
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.
Yes, copying same thing on multiple places doesn't seem good but I couldn't find a way too.
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 wonder, not as part of this PR, whether we should something like
I would like to filter the set of artifacts uploaded in case of failures, which would be a lot easier if we had something like this...
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.
Yes, I was thinking if we could ask for a feature request for something like this to cirrus?