Skip to content

Commit

Permalink
1.6.1dev: use macos-14 instead of deprecated macos-12 on GitHub Actions
Browse files Browse the repository at this point in the history
git-svn-id: http://trac.edgewall.org/intertrac/log:/branches/1.6-stable@17846 af82e41b-90c4-0310-8c96-b1721e28e2e2
  • Loading branch information
jomae committed Sep 30, 2024
1 parent 63245dc commit b088f60
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 92 deletions.
96 changes: 28 additions & 68 deletions .github/posix-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,35 @@ build_svnpy() {
sudo apt-get install -qq -y libsvn-dev libapr1-dev libaprutil1-dev liblz4-dev libutf8proc-dev
with_apr=/usr/bin/apr-1-config
with_apr_util=/usr/bin/apu-1-config
with_lz4=std
with_utf8proc=std
cflags=''
ldflags=''
;;
macos-*)
brew install apr apr-util lz4 utf8proc
brew install -q apr apr-util lz4 utf8proc
with_apr="$(brew --prefix apr)/bin/apr-1-config"
with_apr_util="$(brew --prefix apr-util)/bin/apu-1-config"
with_lz4="$(brew --prefix lz4)"
with_utf8proc="$(brew --prefix utf8proc)"
cflags="$(pkg-config --cflags-only-I libsvn_subr)"
ldflags="$(pkg-config --libs-only-L libsvn_subr)"
;;
esac
installed_libs="$(pkg-config --list-all |
sed -n '/^libsvn_/ { s/ .*$//; p; }' |
sort |
tr '\n' ',' |
sed -e 's/,$//')"
if grep -q 'with-swig-python' configure; then
opt_swig_python="--with-swig-python=$python"
opt_swig_perl='--without-swig-perl'
opt_swig_ruby='--without-swig-ruby'
else
opt_swig_python="PYTHON=$python"
opt_swig_perl='PERL=none'
opt_swig_ruby='RUBY=none'
fi

test -d "$HOME/arc" || mkdir "$HOME/arc"
curl -s -o "$svntarball" "$svnurl"
Expand All @@ -42,6 +59,8 @@ build_svnpy() {
./configure --prefix="$venvdir" \
--with-apr="$with_apr" \
--with-apr-util="$with_apr_util" \
--with-lz4="$with_lz4" \
--with-utf8proc="$with_utf8proc" \
--with-py3c="$GITHUB_WORKSPACE/py3c" \
--without-apxs \
--without-doxygen \
Expand All @@ -50,9 +69,12 @@ build_svnpy() {
--without-gnome-keyring \
--without-kwallet \
--without-jdk \
PERL=none \
RUBY=none \
PYTHON="$python"
"$opt_swig_python" \
"$opt_swig_perl" \
"$opt_swig_ruby" \
PYTHON="$python" \
CFLAGS="$cflags" \
LDFLAGS="$ldflags"
make -j3 swig_pydir="${sitedir}/libsvn" \
swig_pydir_extra="${sitedir}/svn" \
swig-py
Expand All @@ -63,76 +85,14 @@ build_svnpy() {
cd "$OLDPWD"
}

init_postgresql() {
case "$MATRIX_OS" in
ubuntu-*)
sudo systemctl start postgresql.service
;;
macos-*)
rm -rf /usr/local/var/postgres
pg_ctl initdb --pgdata /usr/local/var/postgres
pg_ctl -w start --pgdata /usr/local/var/postgres --log /usr/local/var/postgres/postgresql.log || {
echo "Exited with $?"
cat /usr/local/var/postgres/postgresql.log
exit 1
}
createuser -s postgres
;;
esac
{
case "$MATRIX_OS" in
ubuntu-*)
sudo -u postgres psql -e
;;
macos-*)
psql -U postgres -e
;;
esac
} <<_EOS_
CREATE USER tracuser NOSUPERUSER NOCREATEDB CREATEROLE PASSWORD 'password';
CREATE DATABASE trac OWNER tracuser;
_EOS_
}

init_mysql() {
case "$MATRIX_OS" in
ubuntu-*)
sudo systemctl start mysql.service
{
echo '[client]'
echo 'host = localhost'
echo 'user = root'
echo 'password = root'
} >~/.my.cnf
;;
macos-*)
brew install mysql
mysql.server start
{
echo '[client]'
echo 'host = localhost'
echo 'user = root'
} >~/.my.cnf
;;
esac
mysql -v <<_EOS_
CREATE DATABASE trac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER tracuser@'%' IDENTIFIED BY 'password';
GRANT ALL ON trac.* TO tracuser@'%';
FLUSH PRIVILEGES;
_EOS_
}

case "$MATRIX_OS" in
ubuntu-*)
sudo apt-get update -qq
sudo apt-get install -qq -y subversion
;;
macos-*)
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK
brew update || :
brew install subversion
brew update -q || :
brew install -q subversion
;;
esac

Expand Down
31 changes: 15 additions & 16 deletions .github/posix-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ init_postgresql() {
sudo systemctl start postgresql.service
;;
macos-*)
rm -rf /usr/local/var/postgres
pg_ctl initdb --pgdata /usr/local/var/postgres
pg_ctl -w start --pgdata /usr/local/var/postgres --log /usr/local/var/postgres/postgresql.log || {
echo "Exited with $?"
cat /usr/local/var/postgres/postgresql.log
exit 1
}
createuser -s postgres
brew install -q postgresql@14
brew services start postgresql@14
for i in $(seq 1 15); do
psql -U "$LOGNAME" postgres -t -c 'SELECT version()' && break
sleep 1
done
;;
esac
{
Expand All @@ -24,7 +22,7 @@ init_postgresql() {
sudo -u postgres psql -e
;;
macos-*)
psql -U postgres -e
psql -U "$LOGNAME" postgres -e
;;
esac
} <<_EOS_
Expand All @@ -45,7 +43,7 @@ init_mysql() {
} >~/.my.cnf
;;
macos-*)
brew install mysql
brew install -q mysql
mysql.server start
{
echo '[client]'
Expand Down Expand Up @@ -75,8 +73,11 @@ run_tests() {
(
case "$MATRIX_OS" in
macos-*)
LDFLAGS='-L/usr/local/opt/openssl/lib'
export LDFLAGS
brew install -q libpq openssl
PATH="$PATH:$(brew --prefix libpq)/bin"
CFLAGS="-L$(brew --prefix openssl)/include"
LDFLAGS="-L$(brew --prefix openssl)/lib"
export CFLAGS LDFLAGS
;;
esac
pip install -r .github/requirements.txt
Expand Down Expand Up @@ -118,10 +119,8 @@ case "$MATRIX_OS" in
sudo apt-get install -qq -y subversion
;;
macos-*)
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK
brew update || :
brew install subversion
brew update -q || :
brew install -q subversion tidy-html5
;;
esac

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-22.04, macos-14]
python-version: ['3.12']
tests: [functional]

Expand Down Expand Up @@ -85,11 +85,11 @@ jobs:
- {os: ubuntu-22.04, python-version: '3.7', tracdb: ''}
- {os: ubuntu-20.04, python-version: '3.6', tracdb: ''}
- {os: ubuntu-20.04, python-version: '3.5', tracdb: ''}
- {os: macos-12, python-version: '3.12', tracdb: sqlite, tests: functional}
- {os: macos-12, python-version: '3.12', tracdb: postgresql}
- {os: macos-12, python-version: '3.12', tracdb: mysql}
- {os: macos-12, python-version: '3.12', tracdb: ''}
- {os: macos-12, python-version: '3.11', tracdb: ''}
- {os: macos-14, python-version: '3.12', tracdb: sqlite, tests: functional}
- {os: macos-14, python-version: '3.12', tracdb: postgresql}
- {os: macos-14, python-version: '3.12', tracdb: mysql}
- {os: macos-14, python-version: '3.12', tracdb: ''}
- {os: macos-14, python-version: '3.11', tracdb: ''}

env:
MATRIX_OS: ${{ matrix.os }}
Expand Down Expand Up @@ -160,8 +160,8 @@ jobs:
- {os: ubuntu-22.04, python-version: '3.7'}
- {os: ubuntu-20.04, python-version: '3.6'}
- {os: ubuntu-20.04, python-version: '3.5'}
- {os: macos-12, python-version: '3.12'}
- {os: macos-12, python-version: '3.11'}
- {os: macos-14, python-version: '3.12'}
- {os: macos-14, python-version: '3.11'}

env:
MATRIX_OS: ${{ matrix.os }}
Expand Down

0 comments on commit b088f60

Please sign in to comment.