forked from postgres/postgres
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add feature to use different meson versions
We want to have a branch that uses a specific branch of meson for all tasks. Then, we can create a Cirrus cron "job" that tests Postgres againts different meson branches. Set a different meson branch by using `MESON_REPO` and `MESON_BRANCH` environment variables. Use a bash script to install this specific meson branch and rebase current Postgres branch onto Postgres HEAD. Fixes #81.
- Loading branch information
Showing
3 changed files
with
74 additions
and
1 deletion.
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 |